2021年4月7日星期三

Using JSON as Serialisation for Spring Remoting in Camel

For a few years we have been doing Spring Remoting using Camel and ActiveMQ.

On the client side we define a bean for the remote service like the following:

<bean id="someService" class="org.apache.camel.spring.remoting.CamelProxyFactoryBean">      <property name="serviceUrl" value="jms:queue:someService"/>      <property name="serviceInterface" value="services.api.SomeService"/>  </bean>  

And on the server side we define a route as follows:

<route>      <from uri="jms:queue:someService"/>      <to uri="bean:services.api.SomeService"/>  </route>  

This has worked really well for us, apart from the fact that this uses Java Serialisation to transport the method parameters, and this is fraught with changes to the objects passed.

We would like to change to using JSON as the method to marshall/unmarshall the method parameters.

I have spent a couple of hours trying to google this, but haven't found anything close. Perhaps I'm just not searching for the right thing.

Has anyone done this, and can point me to an example on the 'net somewhere?

https://stackoverflow.com/questions/66997204/using-json-as-serialisation-for-spring-remoting-in-camel April 08, 2021 at 12:06PM

没有评论:

发表评论