Capturing JMS events/Working with JMS (Java Messaging) in WCM

Few important things while working with JMS related in the WCM

1.      Changing the required WCM config service resource properties

This must be set to true to enable message generation and delivery. Default value: false
Indicates whether item topics are published. This must be set to true to enable messages for item state changes.Default value: true
Indicates whether syndication topics are published. This must be set to true to enable messages for the status of syndication. Default value: true
Indicates whether pre-render topics are published. This must be set to true to enable messages for the status of pre-rendering.Default value: true
The JNDI name of the JMS topic for status changes.
Format for item state changes: jms/IWKTopics/Items

Format for syndication state changes: jms/IWKTopics/Syndication

Format for pre-rendering state changes: jms/IWKTopics/PreRender

Default value: None

I have used the following values

topic.publishing.enabled                 :::true      
items.topic.publishing.enabled         :::true      
prerender.topic.publishing.enabled  :::false                             :::jms/IWKTopics/Items  

NOTE : Refer the infocenter for more details on configuration options (links are listed under resources)

2.      Creating the WCM JMS resources using the configengine task

ConfigEngine.bat/sh create-wcm-jms-resources -DPortalAdminId=username -DPortalAdminPwd=password -DuseRemoteEndPoints=false

NOTE: -DuseRemoteEndPoints=true to create the JMS resources in the cluster environment

When you execute above configengine task, portal creates following JMS resources,

a)      Creates JMS BUS called “IWKBus” and adds Portal Server/cluster as member
b)      Creates TopicSpace called “IWK.Topic.Space”
c)      Creates TopicConnectionFactory “IWKMessagingTopicConnectionFactory”
d)      Creates following topics “IWKTopics_Items” ,” IWKTopics_PreRender” & “IWKTopics_Syndication”

e)      Creates BUS queue destination “IWKQueue4IWKBus”
f)       Creates the QueueConnectionFactory “IWKQueueConnectionFactory”
g)      Creates following Queues i.e “IWKSyndicationQ” & “IWKPrerenderQ”

h)      Creates following Activation Specs i.e “IWKSyndicationMonitorActivation” & “IWKItemChangeMonitorActivation”

3.      Write MDB( message driven bean)

Write your custom business logic in the “onMessage” method of MDB  and bind that MDB in EJB binding file like below.

<jca-adapter activation-spec-binding-name="jms/IWKItemChangeMonitorActivation" destination-binding-name="jms/IWKTopics/Items"/>

4.      Message Selectors : you can specify the message selectors to avoid executing or calling the onMessage method for every item changes.


1.      Had problem while running the config engine task, I had to provide the portal admin userid and password in file ( Some it didn’t accept the userid and password that is passed from command line)
2.      MessageSelectors didn’t work most of the time.


1 comment:

  1. You actually have to add -DWasPassword= as an argument to the command line, then it works.