The following snippet shows extracts related to setting up the message broker from the Source, Transformer, and Sink applications:
#Source Log
CachingConnectionFactory : Created new connection: SimpleConnection@725b3815 [delegate=amqp://[email protected]:5672/, localPort= 58373]
#Transformer Log
o.s.i.endpoint.EventDrivenConsumer : Adding {transformer:stockIntelligenceProcessorApplication.addOurInventory.transformer} as a subscriber to the 'input' channel
o.s.integration.channel.DirectChannel : Channel 'application:0.input' has 1 subscriber(s).
o.s.i.endpoint.EventDrivenConsumer : started stockIntelligenceProcessorApplication.addOurInventory.transformer
o.s.i.endpoint.EventDrivenConsumer : Adding {message-handler:inbound.process-stock-change-events.significant-stock-change-source.process-stock-change-events} as a subscriber to the 'bridge.process-stock-change-events.significant-stock-change-source' channel
o.s.i.endpoint.EventDrivenConsumer : started inbound.process-stock-change-events.significant-stock-change-source.process-stock-change-events
#Sink Log
c.s.b.r.p.RabbitExchangeQueueProvisioner : declaring queue for inbound: process-stock-change-events.stock-intelligence-processor.process-stock-change-events, bound to: process-stock-change-events.stock-intelligence-processor
o.s.a.r.c.CachingConnectionFactory : Created new connection: SimpleConnection@3de6223a [delegate=amqp://[email protected]:5672/, localPort= 58372]
A few things to note are as follows:
- Created new connection: SimpleConnection@725b3815 [delegate=amqp://[email protected]:5672/, localPort= 58373]: Since we added spring-cloud-starter-stream-rabbit into the classpath of all three applications, the message broker used is RabbitMQ.
- Adding {transformer:stockIntelligenceProcessorApplication.addOurInventory.transformer} as a subscriber to the 'input' channel: Similar to this, the input and/or output channels of each application are set up on the message broker. Source and processor applications listen on the channels for incoming messages.