This answer will not directly address the question but it will show you how you can view the content of the ObjectMessage
s from a WSO2 message store's JMS queue within ActiveMQ console. This is especially important when the processor reading from the store fails to process the message and you need to know what that message contains in order to further debug your problem.
If you're not modifying anything on the ActiveMQ side and you're trying to view the message details from a store's JMS queue, you get the following exception due to WSO2-side serialization:
javax.jms.JMSException: Failed to build body from content. Serializable class not available to broker. Reason: java.lang.ClassNotFoundException: org.apache.synapse.message.store.impl.jms.StorableMessage
I have found the StorableMessage
class in the synapse-core_2.1.2.wso2v4.jar (ESB_ROOT/repository/components/plugins). If you only deploy that jar to ACTIVEMQ_ROOT/lib without modifications, you will only get the return of the Object
's toString()
method, which is not helpful.
So what you can do is either reverse engineer the StorableMessage
class from the jar OR get a version of StorableMessage and add the following to it:
@Override
public String toString() {
return axis2message.getSoapEnvelope();
}
and
private static final long serialVersionUID = 319132393668950267L;
I set that serialVersionUID
to the long value set on the WSO2 side upon serialization after getting an error about mismatching IDs in the ActiveMQ console when trying to view the message details. This might change with each upgrade of the ESB as it is most likely set by the JVM since I didn't see one specifically defined in the source code. If that's the case, the StorableMessage
class will need to be changed to reflect the new ID.
Build the modified class using the same jar for classpath:
javac -cp synapse-core_2.1.2.wso2v4.jar StorableMessage.java
You can use a zip utility or the jar command to add (overwrite) the new StorableMessage
class to the synapse-core_2.1.2.wso2v4.jar file.
Last step is to deploy the updated jar to the ACTIVEMQ_ROOT/lib directory and bounce ActiveMQ server.
I hope this helps someone. :)