How to integrate with Block Management Agent
-
Install NuGet Package
Bosch.Nexeed.BlockManagement.Agent
-
Add Service
builder.Services.AddBlockManagementAgentService(builder.Configuration);
-
Add Configurations
After integrating theBosch.Nexeed.BlockManagement.Agent
package, the third-party module will communicate with Block Management through RabbitMQ. Therefore, it is necessary to configure the RabbitMQ-related information. Add the "BlockManagementAgent" node along with its configuration parameters to the appsettings.json file.
Supported Routing Keys:
-
bosch.ias.blockmanagement.internal.block.created.v1
-
bosch.ias.blockmanagement.internal.block.activated.v1
-
bosch.ias.blockmanagement.internal.block.releaseactivated.v1
-
bosch.ias.blockmanagement.internal.block.released.v1
-
bosch.ias.blockmanagement.app.block.created.v1
-
bosch.ias.blockmanagement.app.block.released.v1
You have the flexibility to customize all "Assembly1" values in the following settings example according to your module.
"BlockManagementAgent": {
"IsEnabled": true,
"HttpClientName": "LineControlAssemblyClient",
"SourcePlant": "LineControl",
"SourceApplication": "LineControl.Assembly",
"SourceApplicationToken": "LineControl.Assembly1", // unique token
"ServiceUrl": "https://{{url}}/bms/bms-backend", // replace with the actual URL
"AutoSyncBlocksFromBMS": true,
"IsClient": false,
"EventBus": {
"Connectors": [
{
"Name": "BlockManagementRabbitMqConnector",
"Hostname": "",
"Port": 5672,
"SslEnabled": false,
"SslVersion": "Tls12",
"ClientId": "BlockManagement",
"Username": "",
"Password": "",
"IsAutoRecovered": true,
"RecoveryInterval": "00:01:00"
}
],
"Publishers": [
{
"Name": "BlockManagementAgentPublisher", // DO NOT change this value, internal listener publisher (retry strategy ...)
"Exchange": {
"Name": "x.blockmanagement.domain",
"Type": "Topic",
"Durable": true,
"ttl": -1
}
},
{
"Name": "BlockManagementAgentInternalPublisher", // DO NOT change this value, publish message to the main exchange
"Exchange": {
"Name": "bms.agent.default.router", //in NIAS it is x.nexeed.integration and means the main exchange
"Type": "Topic",
"Durable": true,
"ttl": -1
}
}
],
"Subscribers": [
{
"RetryCount": 0,
"AutoAcknowledge": false,
"Name": "BlockManagementAgentSubscriber", // DO NOT change this value
"Exchange": {
"Name": "x.blockmanagement.domain",
"Type": "Topic",
"Durable": true,
"ttl": -1
},
"DeadLetterExchange": {
"Name": "x.blockmanagement.assembly1.deadletter", // unique dead letter exchange name
"Type": "Direct",
"ttl": -1
},
"BindToExchanges": [
{
"Name": "bms.agent.default.router", // the main exchange in NIAS
"RoutingKeys": [
"bosch.ias.blockmanagement.app.block.created.v1",
"bosch.ias.blockmanagement.app.block.released.v1"
]
}
],
"Queue": {
"Name": "q.blockmanagement.assembly1", // unique queue name for this application
"AutoAcknowledge": false,
"Durable": true,
"ttl": -1
},
"DeadLetterQueue": {
"Name": "q.blockmanagement.assembly1.deadletter", // unique dead letter queue name
"Durable": true,
"AutoDelete": false,
"Excluxive": false,
"ttl": 1728000000,
"DeadLetterRoutingKey": "q.blockmanagement.assembly1.deadletter"
}
}
]
}
}