Follow Techotopia on Twitter

On-line Guides
All Guides
eBook Store
iOS / Android
Linux for Beginners
Office Productivity
Linux Installation
Linux Security
Linux Utilities
Linux Virtualization
Linux Kernel
System/Network Admin
Programming
Scripting Languages
Development Tools
Web Development
GUI Toolkits/Desktop
Databases
Mail Systems
openSolaris
Eclipse Documentation
Techotopia.com
Virtuatopia.com
Answertopia.com

How To Guides
Virtualization
General System Admin
Linux Security
Linux Filesystems
Web Servers
Graphics & Desktop
PC Hardware
Windows
Problem Solutions
Privacy Policy

  




 

 

Messaging in Seam

Seam makes it easy to send and receive JMS messages to and from Seam components.

Configuration

To configure Seam's infrastructure for sending JMS messages, you need to tell Seam about any topics and queues you want to send messages to, and also tell Seam where to find the QueueConnectionFactory and/or TopicConnectionFactory.
Seam defaults to using UIL2ConnectionFactory which is the usual connection factory for use with JBossMQ. If you are using some other JMS provider, you need to set one or both of queueConnection.queueConnectionFactoryJndiName and topicConnection.topicConnectionFactoryJndiName in seam.properties, web.xml or components.xml.
You also need to list topics and queues in components.xml to install Seam managed TopicPublishers and QueueSenders:
<jms:managed-topic-publisher name="stockTickerPublisher" 
                   auto-create="true  topic-jndi-name="topic/stockTickerTopic"/>

<jms:managed-queue-sender name="paymentQueueSender" auto-create="true" 
    queue-jndi-name="queue/paymentQueue"/>
Using JBoss Messaging
For using JBoss Messaging which comes with JBoss Enterprise Application Platform 4.3, you should first set the value of the properties 'queueConnection.queueConnectionFactoryJndiName' and 'topicConnection.topicConnectionFactoryJndiName' to 'ConnectionFactory' which is the default connection factory for JBoss Messaging. Then set the value of the 'connectionProvider' property to 'org.jboss.seam.remoting.messaging.JBossMessagingConnectionProvider' on the class component 'org.jboss.seam.remoting.messaging.SubscriptionRegistry', which creates topic connections for jboss messaging.
<component name="org.jboss.seam.jms.topicConnection">
	<property name="topicConnectionFactoryJndiName">
	ConnectionFactory
	</property>
</component>
<component class="org.jboss.seam.remoting.messaging.SubscriptionRegistry" installed="true">
	<property name="allowedTopics">
	chatroomTopic
	</property>
	<property name="connectionProvider">
	org.jboss.seam.remoting.messaging.JBossMessagingConnectionProvider
	</property>
</component>
You also need to update the topics to use JBoss Messaging as shown in the code fragment below.
<server>
	<mbean code="org.jboss.jms.server.destination.TopicService"
               name="jboss.messaging.destination:service=Topic,name=chatroomTopic"
                                            xmbean-dd="xmdesc/Topic-xmbean.xml">
		<depends optional-attribute-name="ServerPeer">
		jboss.messaging:service=ServerPeer
		</depends>
		<depends>
		jboss.messaging:service=PostOffice
		</depends>
		<attribute name="SecurityConfig">
			<security>
			  <role name="guest" read="true" write="true"/>
			  <role name="publisher" read="true" write="true" create="false"/>
			  <role name="durpublisher" read="true" write="true" create="true"/>
			</security>
		</attribute>
	</mbean>
</server>

 
 
  Published under the terms of the Open Publication License Design by Interspire