The JMS Feeder component monitors a JMS queue and publishes the received messages to an Aspire pipeline. By default, the queue is configured for ActiveMQ, but can also be configured using JNDI for any JMS queue provider. The queue can be a queue or a topic, and may be durable.
When started, the feeder listens to the queue. When an XML message is received, the id and the action of the message are extracted from the message. The location of these items is specified as an xpath in the configuration. The message is then optionally transformed using XSLT before being published on an event based on the action.
Note: There is no difference in operation between full and incremental feeding for this feeder. After it is started, the feeder listens for messages until it is stopped.
This feeder is based on the Simple Feeder
JMS Message Feeder | |
---|---|
Factory Name | com.searchtechnologies.aspire:aspire-jmsfeeder |
subType | default |
Inputs | JMS Queue |
Outputs | An AspireObject containing data from the JMS message, published to the configured pipeline manager. |
This feeder takes all parameters from the Simple Feeder plus the following:
Element | Type | Default | Description |
---|---|---|---|
feederLabel | string | JMSFeed | The feeder label submitted in the <feederLabel> of the published document and when querying the CCD. |
queue | None | The JMS Queue to listen on. See below. | |
message/@idPath | String | /doc/fetchUrl | The xpath to the document id in the received message. |
message/@actionPath | String | /doc/@action | The xpath to the document action in the received message. The action should be on of insert, update or delete. |
message/@transform | String | None | The name of the file holding the XSLT to apply to the incomming message before forwarding on to the pipeline. |
events | String | See below | The events to publish documents against. See below. |
The JMS feeder listens on a configurable JMS queue.
Element | Type | Default | Description |
---|---|---|---|
queue/@name | String | None | The name of the JMS queue to listen on. |
queue/@clientId | String | None | The id of this feeder given to the JMS broker. |
queue/@topic | Boolean | false | True if using a JMS Topic rather than a queue. |
queue/@durable | Boolean | false | True if this JMS Queue or Topic is durable. |
queue/@transacted | Boolean | false | True if this JMS Queue or Topic is transacted. |
queue/@jndi | Boolean | false | False if the connection to this JMS Queue or Topic is to be made using the built-in ActiveMQ libraries. True if you wish to use JNDI to specify the connection method. In this case, you should use the jndi/prop elements of the configuration to specify the required configuration. Multiple jndi/prop elements are permitted. At a minimum you should set:java.naming.factory.initial java.naming.provider.url |
queue/jndi/prop/@name | String | None | The name of a JNDI property to set. The property will be set before the connection to the queue is connected to. |
queue/jndi/prop/@value | String | None | The value of the named JNDI property to set. The property will be set before the connection to the queue is connected to. |
queue/jndi/classPath | String | None | The class path of jar files needed for the classes used in the JNDI connection. This is a list of jar files (relative to Aspire home) separated by the path separator character (: on Unix and ; on Windows). |
The JMSfeeder publishes differing actions against differing events meaning different pipelines can be used to handle different actions.
Element | Type | Default | Description |
---|---|---|---|
events/insert/@event | String | onPublish | The event to publish against for an insert. |
events/update/@event | String | onPublish | The event to publish against for an update. |
events/delete/@event | String | onDelete | The event to publish against for a delete. |
The JMSfeeder publishes documents using the branch manager. It publishes using the events configured above. You must therefore include <branches> for these events in the configuration to publish to a pipeline within a pipeline manager. See Branch Handler for more details.
<component name="EM3UpdateFeeder" subType="default" factoryName="aspire-jmsfeeder"> <feederLabel>EM3QueueFeeder</feederLabel> <autoStart>${autoFeedEM3Update}</autoStart> <queue name="EM3UpdateQueue" durable="true" topic="true" clientId="AspireQueueFeeder" /> <message idPath="/update/@entityId" actionPath="/update/@entityAction" transform="config/jmsUpdate2Aspire.xsl"/> <branches> <branch event="onPublish" pipelineManager="EM3Update-pipe-manager" pipeline="EM3Publish-pipeline" /> <branch event="onUpdate" pipelineManager="EM3Update-pipe-manager" pipeline="EM3Update-pipeline" /> <branch event="onDelete" pipelineManager="EM3Update-pipe-manager" pipeline="EM3Delete-pipeline" /> </branches> </component>
<component name="EM3UpdateFeeder" subType="default" factoryName="aspire-jmsfeeder"> <feedWait>5000</feedWait>" <loopWait>3600000</loopWait>" <feederLabel>CrawlJMS</feederLabel>" <maxErrorsRetained>20</maxErrorsRetained>" <statsPeriod>20</statsPeriod>" <feederLabel>EM3QueueFeeder</feederLabel> <autoStart>${autoFeedEM3Update}</autoStart> <queue name="EM3UpdateQueue" durable="true" topic="true" clientId="AspireQueueFeeder1" jndi="true"> <jndi> <prop name="java.naming.factory.initial" value="org.apache.activemq.jndi.ActiveMQInitialContextFactory"/> <prop name="java.naming.provider.url" value="tcp://localhost:61616"/> <jar file="lib/activemq-core-5.0.0.jar"/> </jndi> </queue> <message idPath="/update/@entityId" actionPath="/update/@entityAction" transform="config/jmsUpdate2Aspire.xsl"/> <events> <insert event="onPublish"/> <update event="onUpdate"/> <delete event="onDelete"/> </events> <branches> <branch event="onPublish" pipelineManager="EM3Update-pipe-manager" pipeline="EM3Publish-pipeline" /> <branch event="onUpdate" pipelineManager="EM3Update-pipe-manager" pipeline="EM3Update-pipeline" /> <branch event="onDelete" pipelineManager="EM3Update-pipe-manager" pipeline="EM3Delete-pipeline" /> </branches> </component>
The following JNDI configuration works against a JMS queue under WebSphere 7:
<queue name="jms/topic/searchevents" connectionFactoryName="jms/cf/searchevents" durable="true" topic="true" clientId="UpdateFeeder" jndi="true"> <jndi> <prop name="java.naming.factory.initial" value="com.ibm.websphere.naming.WsnInitialContextFactory"/> <prop name="java.naming.provider.url" value="iiop://dev:2809"/> <prop name="org.omg.CORBA.ORBClass" value="com.ibm.CORBA.iiop.ORB"/> <classPath>lib/com.ibm.ws.admin.client_7.0.0.jar;lib/com.ibm.ws.orb_7.0.0.jar;lib/com.ibm.ws.runtime.jar;lib/com.ibm.ws.sib.client.thin.jms_7.0.0.jar</classPath> </jndi> </queue>