https://grokonez.com/java-integration/spring-jms-activemq-send-java-object-messages-activemq-server-specially-bi-directional-relationship-java-objects

Spring Jms ActiveMq – How to send Java object messages to ActiveMQ server (specially with Bi-Directional relationship Java objects)

The previous Spring ActiveMQ tutorials, We had learned How to produce and consume JMS messages with String format and configure Explicity ActiveMq ConnectionFactory. But How to send Java object messages to ActiveMQ server? With the tutorial, JavaSampleApproach will show you how to produce/consume Java object messages with Spring JMS ActiveMq for both case: normal Java objects and complex Java objects with Bi-directional relationship.

Related posts:

I. Sending Java object messages to ActiveMq

1. Jms MessageConverter

We start with a simple model:

public class Company {
    private String name;
	
    public Company(){
    }
	
	...
}

Send a Company object to ActiveMq:


jmsTemplate.convertAndSend(queue, new Company("Apple"));

-> thrown MessageConversionException exception:

More at:

https://grokonez.com/java-integration/spring-jms-activemq-send-java-object-messages-activemq-server-specially-bi-directional-relationship-java-objects

Spring Jms ActiveMq – How to send Java object messages to ActiveMQ server (specially with Bi-Directional relationship Java objects)

#springjms #springboot #activemq #java

Spring Jms ActiveMq - How to send Java object messages to ActiveMQ server
2.65 GEEK