Example: Creating a new JMS header

This example shows you how to create a new JMS header for the ServiceMessageObject object inside a Custom Mediation primitive.

Context

The following code sample shows you how to create a new JMS header for the ServiceMessageObject object inside a Custom Mediation primitive. The Custom Mediation primitive is used to replace the JMS header inside incoming ServiceMessageObject object.

Requirements

You must know how to set up a mediation flow with a Custom Mediation primitive.

Java imports

import com.ibm.websphere.sibx.smobo.JMSHeaderType; 
import com.ibm.websphere.sibx.smobo.ServiceMessageObjectFactory; 

Code sample

. 
. 
. 
ServiceMessageObjectFactory smoFactory = ServiceMessageObjectFactory.eINSTANCE; 
JMSHeaderType jmsHeader = smoFactory.createJMSHeaderType();
This code sample creates a new JMS header. An exception occurs if the code sample fails.