0

I'm using WSO2 EI 6.5.0 to send message to activemq 5.16.3. I have followed this blog steps to set up WSO2 EI and ActiveMQ.

API Code:

<?xml version="1.0" encoding="UTF-8"?>
<api context="/activemqsapi" name="ActiveMQAPI" xmlns="http://ws.apache.org/ns/synapse">
    <resource methods="POST">
        <inSequence>
            <log level="custom">
                <property name="===ActiveMQAPI" value="is called===="/>
            </log>
            <property name="OUT_ONLY" scope="default" type="STRING" value="true"/>
           <property name="FORCE_SC_ACCEPTED" value="true" scope="axis2"/>
            <send>
                <endpoint>
                    <address uri="jms:/WSO2EIQ?transport.jms.ConnectionFactoryJNDIName=QueueConnectionFactory&amp;java.naming.factory.initial=org.apache.activemq.jndi.ActiveMQInitialContextFactory&amp;java.naming.provider.url=tcp://localhost:61616&amp;transport.jms.DestinationType=queue">
                        <suspendOnFailure>
                            <initialDuration>-1</initialDuration>
                            <progressionFactor>1</progressionFactor>
                        </suspendOnFailure>
                        <markForSuspension>
                            <retriesBeforeSuspension>0</retriesBeforeSuspension>
                        </markForSuspension>
                    </address>
                </endpoint>
            </send> 
          
        </inSequence>
        <outSequence/>
        <faultSequence/>
    </resource>
</api>

Message Details are shown like below in activeMQ.

Failed to build body from content. Serializable class not available to broker. Reason: java.lang.ClassNotFoundException: org.apache.synapse.message.store.impl.commons.StorableMessage

As per this question i have added property in %ACTIVEMQ_HOME%\bin\win64\wrapper.conf which also not working.

wrapper.java.additional.13=Dorg.apache.activemq.SERIALIZABLE_PACKAGES="*"

wrapper file

Can anyone help me on this?

Community
  • 1
  • 1
Justin
  • 855
  • 2
  • 11
  • 30
  • I would discourage you from using `ObjectMessage` if at all possible. `ObjectMessage` depends on Java serialization to (un)marshal the payload which is generally considered unsafe because malicious payloads can exploit the host system. [Lots of CVEs](https://cve.mitre.org/cgi-bin/cvekey.cgi?keyword=objectmessage) have been created for this. There are also a number of other issues not related to security that you should [read about](http://jmesnil.net/weblog/2012/07/27/on-jms-objectmessage-and-its-pitfalls/). This article has a good suggestion for how to replace `ObjectMessage` using JSON, etc. – Justin Bertram Dec 25 '21 at 01:12
  • Aside from the architectural and security issues with `ObjectMessage` it's worth noting that Java serialization is also *slow*. – Justin Bertram Dec 25 '21 at 01:12

1 Answers1

0

As per this doc, added below line in windows.bat file which resolved my issue.

org.apache.activemq.SERIALIZABLE_PACKAGES="*"

Now I can able to see newly posted message in active-mq console.

Justin
  • 855
  • 2
  • 11
  • 30