Reputation: 645
My apps have spring-boot-starter-artemis
dependency with 1.5.8 version. External Artemis server uses 2.6.0. One app is publishing messages to the address: tacocloud.order.queue:
@Configuration
public class ApplicationConfiguration {
@Bean
public Destination orderQueue() {
return new ActiveMQQueue("tacocloud.order.queue");
}
}
Service layer of the first app:
@Service
@RequiredArgsConstructor(onConstructor = @__(@Autowired))
public class JmsOrderMessagingService implements OrderMessagingService {
private final JmsTemplate jmsTemplate;
private final Destination destination;
@Override
public void sendOrder(Order order) {
jmsTemplate.send(destination, session -> {
Message message = session.createObjectMessage(order);
message.setStringProperty("X_ORDER_SOURCE", "WEB");
return message;
});
}
}
Second app is listening on the address: tacocloud.order.queue
@RestController
@RequiredArgsConstructor(onConstructor = @__(@Autowired))
public class OrderReceiver {
private final JmsTemplate jmsTemplate;
@GetMapping("/new/message")
public Message receiveOrder() {
return jmsTemplate.receive("tacocloud.order.queue");
}
}
Though the specified address to listen to is tacocloud.order.queue, in the Artemis Management console it is registered as jms.queue.tacocloud.order.queue.
Question: how to make 2 apps hear each other?
Upvotes: 0
Views: 150
Reputation: 35162
You need to either:
spring-boot-starter-artemis
(e.g. 2.0.3.RELEASE
).anycastPrefix=jms.queue.;multicastPrefix=jms.topic.
. This is noted in the Artemis documentation when upgrading from 2.4.0. Upvotes: 1