Problem setting custom JMS properties within Switchyard project

Solution Unverified - Updated -


I have a Switchyard project in which I need to deliver a JMS message with some custom JMS properties. The value of one of the properties is only known within the component implementation (Java bean). I have tried to add properties to the exchange context, but the context handled by the JMSContextMapper doesn't contain my properties:

public class MyServiceInterfaceBean implements MyServiceInterface {
    private Exchange exchange;

    private MyReferenceInterface myReferenceInterface;

    public void myMethod(final String propertyValue) {
        System.out.println("Entering MyServiceInterfaceBean.myMethod(" + propertyValue + ")");

        // setting properties which should be used as JMS properties
        Context context = exchange.getContext();
        context.setProperty("Property_A", propertyValue);

        // deliver message (JMS message)
        try {
        myReferenceInterface.myMethod("Test message");
        } catch(Exception ex) {

        // doing some additional things...

        System.out.println("Leaving MyServiceInterfaceBean.myMethod(" + propertyValue + ")");

What must I do to set the custom JMS properties?


  • Red Hat JBoss Fuse Service Works
    • 6.0.0

Subscriber exclusive content

A Red Hat subscription provides unlimited access to our knowledgebase of over 48,000 articles and solutions.

Current Customers and Partners

Log in for full access

Log In