Problem setting custom JMS properties within Switchyard project

Solution Unverified - Updated -

Issue

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:

@Service(MyServiceInterface.class)
public class MyServiceInterfaceBean implements MyServiceInterface {
    @Inject
    private Exchange exchange;

    @Inject
    @Reference
    private MyReferenceInterface myReferenceInterface;

    @Override
    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) {
         ex.printStackTrace();
        }

        // doing some additional things...

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

What must I do to set the custom JMS properties?

Environment

  • Red Hat JBoss Fuse Service Works
    • 6.0.0

Subscriber exclusive content

A Red Hat subscription provides unlimited access to our knowledgebase, tools, and much more.

Current Customers and Partners

Log in for full access

Log In

New to Red Hat?

Learn more about Red Hat subscriptions

Using a Red Hat product through a public cloud?

How to access this content