15.2.4. Changing Gateway Data Mappings

download PDF
Mappings are changed in different ways for different gateway types:
File Gateways
Instances of the org.jboss.soa.esb.listeners.message.MessageComposer interface are responsible for performing the conversion. To change the default behavior, provide an appropriate implementation that defines your own compose and decompose methods. Make sure that you provide the MessageComposer implementation in the configuration file by using the composer-class attribute name.
JMS and Hibernate Gateways
These implementations use a reflective approach for defining composition classes. Provide your own message composer class and use the composer-class attribute name in the configuration file to inform the gateway which instance to use. You can use the composer-process attribute to inform the Gateway which operation of the class to call when it needs a message. This method must take an object and return a message. If not specified, a default name of process is assumed.

Note

Whichever of the methods you use to redefine the Message composition, it is worth noting that you have complete control over what is in the message and not just the Body. For example, if you want to define ReplyTo or FaultTo end-point references for the newly created message, based on the original content, sender and so forth, then you should consider modifying the header too.
Red Hat logoGithubRedditYoutubeTwitter

Learn

Try, buy, & sell

Communities

About Red Hat Documentation

We help Red Hat users innovate and achieve their goals with our products and services with content they can trust.

Making open source more inclusive

Red Hat is committed to replacing problematic language in our code, documentation, and web properties. For more details, see the Red Hat Blog.

About Red Hat

We deliver hardened solutions that make it easier for enterprises to work across platforms and environments, from the core datacenter to the network edge.

© 2024 Red Hat, Inc.