Create an inbound JMS integration
PolicyCenter uses inbound JMS integration to read information from messages that an external system creates. This integration can be either a message reply plugin or a startable plugin.
The base configuration of PolicyCenter provides implementations for the message reply plugin and the startable plugin for inbound file integration. You can use these plugins as a template for your own plugin. PolicyCenter also provides implementations for the message reply handler plugin and the startable handler plugin for inbound JMS integration. You can use these plugins as a template for your own handler plugin. You provide the handler class that implements your business logic.
Procedure
- In the Project window, navigate to , and then open the inbound-integration-config.xml file.
-
Configure the thread pools.
You can use a thread pool element in the base configuration as a template.
-
In the list of integrations, create one
<integration>element of type<jms-integration>.You can use a<jms-integration>element in the base configuration as a template. -
Set configuration parameter subelements, ensuring that the order of subelements is correct.
The inbound-integration-config.xsd file specifies the correct sequence of the subelements.
-
Set values for JNDI properties in the
<jndi-properties>subelement and its<jndi-property>subelements.Typically, you set values for the naming factory, connection factory, and queue name for your JMS configurations.The following lines show an example configuration for an Apache Artemis broker.<jndi-properties> <jndi-property> <key>java.naming.factory.initial</key> <value>org.apache.activemq.artemis.jndi.ActiveMQInitialContextFactory</value> </jndi-property> <jndi-property> <key>connectionFactory.ConnectionFactory</key> <value>tcp://localhost:61616</value> </jndi-property> <jndi-property> <key>queue.MyQueue</key> <value>MyQueue</value> </jndi-property> </jndi-properties> -
Set values for
<connectionfactoryjndi>and<destinationjndi>subelements.These values must match the JNDI property values for the connection factory and queue name.For the example JNDI properties, these elements look like the following lines.<connectionfactoryjndi>ConnectionFactory</connectionfactoryjndi> <destinationjndi>MyQueue</destinationjndi>
-
Set values for JNDI properties in the
-
Create the inbound JMS integration plugin.
- In Studio, in the Plugins registry, add a new .gwp file.
-
Studio prompts for a plugin name and plugin interface. For the plugin name, use a name that represents
the purpose of this specific inbound integration. For the Interface field, enter one of the following values.
- For a message reply plugin, type
InboundIntegrationMessageReply. - For a startable plugin for non-messaging use, type
InboundIntegrationStartablePlugin.
- For a message reply plugin, type
- Click the plus (+) symbol to add a plugin implementation and choose Add Java plugin.
-
In the Java class field, enter one of the
following plugin types.
- For a message reply plugin, type
com.guidewire.pl.integration.inbound.jms.DefaultJMSInboundIntegrationMessageReply. - For a startable plugin for non-messaging use, type
com.guidewire.pl.integration.inbound.jms.DefaultJMSInboundIntegrationPlugin.
- For a message reply plugin, type
-
Add a plugin parameter with the key
integrationservice. For the value, type the unique name for your integration that you used in inbound-integration-config.xml for this integration.
-
Write your own inbound integration handler plugin implementation.
- For a message reply plugin, implement the interface
gw.plugin.integration.inbound.InboundIntegrationMessageReplyHandler. - For a startable plugin for non-messaging use, implement the interface
gw.plugin.integration.inbound.InboundIntegrationHandlerPlugin.
Both interfaces have one method calledprocess, which has a single argument of typeObject. The method has no return value. The JMS integration calls that method to process one message. Downcast thisObjecttojavax.jms.Messagebefore using it. - For a message reply plugin, implement the interface
-
Create the inbound JMS integration handler plugin to register your handler plugin implementation
class.
- In Studio, in the Plugins registry, add a new .gwp file.
-
Set the interface name to the handler interface that you implemented.
The
Namefield must match the <pluginhandler> subelement in the inbound-integration-config.xml file for this integration. - Click the plus (+) symbol to add a plugin implementation and choose the type of class that you implemented.
- In the class name field, type or navigate to the class that you implemented.
- Start the server in Guidewire Studio and test your new inbound integration by sending one or more JMS messages to the queue that your class handles.
What to do next
See also
