I have a question regarding spring-messaging (spring integration + amqp) with RabbitMQ. I have an application which based on microservices architecture. One service publish message in following way:
@EventListener(AfterCreationEvent.class)
@Publisher(channel = "messages")
public Message<Message> onCreateEntity(AfterCreationEvent<Message> event) {
if (isDisabled()) return null;
String id = event.getSource().getId();
return MessageBuilder.withPayload(event.getSource())
.build();
}
and other messages are listening, for instance
@StreamListener("messages")
public void onMessageReceived(@Payload Message input) {
messageService.save(input)
}
Microservices have following base configuration:
spring:
rabbitmq:
host: rabbit
port: 5672
cloud:
stream:
bindings:
messages:
producer:
required-groups: terminal,chat,security
destination: message.share
binder: rabbit
binders:
rabbit:
type: rabbit
and each service has its own configuration for instance:
spring:
application.name: message
cloud:
stream:
bindings:
messages:
content-type: application/json
and
spring:
application.name: terminal
cloud:
stream:
bindings:
messages:
group: terminal
and it works fine. but it works in asynchronous way but I want to receive reply from each required group that message was delivered. Is it possible?
Right now I'm working with spring-integration-amqp:4.3.1.RELEASE