I am new to spring integration , i am trying to achieve the following through spring integration: there are 3 micro services A,B,C , based on some event i would want to publish a message to spring integration channel to which services B and C should have subscribed. i am unable to figure out a way to make an external service as subscriber. please help. thanks in advance.
Is there a way to make an external service as a subscriber for pubsub model using spring integration
Asked
Active
Viewed 31 times
1 Answers
0
You need to use a message broker such as RabbitMQ, Kafka, JMS etc. to communicate between external services.
Or, you could connect them explicitly using TCP channel adapters or gateways.
Read the reference manual.
See the samples.

Gary Russell
- 166,535
- 14
- 146
- 179
-
HI Gary, Thanks for the reply i am using JMS active MQ where i have created a producer channel which pushes data to the JMS active mq and in another service i have created a cosnumer channel , now the only problem is if i create 2 services which have consumer channel, only one of them reads the data in a load balanced way. i am following link https://codenotfound.com/spring-jms-integration-example.html done few changes like i changed direct channel to pubsub channel and moved the consumer code to another microservice – Shashank Rawat Jul 31 '19 at 12:14
-
ActiveMQ has a `prefetch` option, to improve performance, which (IIRC) defaults to 1000; so that may cause all the messages to be sent to one of the consumers. See https://activemq.apache.org/what-is-the-prefetch-limit-for.html – Gary Russell Jul 31 '19 at 13:00