Ravish Mody

Till now you might have figured out that Weblogic Server is one of the best application server in the market and has lot of feature in-built, from which one of it is that Weblogic server also supports JMS durable subscriptions. For demo you can have a look at this post JMS Demo using WebLogic Durable Subscriber Topic

What is a Durable Subscriptions?

Durable subscriptions means that weblogic server will store the messages in a persistent store (i.e a  file-store or a JDBC-store) until those messages are delivered to the subscribers/listener. This technic helps weblogic server to make sure that  the messages get delivered even if those subscribers/listeners are not active at the time that the message is getting delivered.

As all of us know that in Topic’s the senders/producers just send the messages to the topic and the receivers/listeners have subscribe them self to get those messages, hence senders/producers does not have any concern if the messages are been received or not. However with this feature weblogic make sure all the subscribers would get the messages as the messages gets stored in a persistence store.

This happens by-default with Queue hence we can monitor the messages on the console, but with Topic’s that’s not the case thus durable subscriptions comes into the picture.

Steps to Configure Durable Subscribers Topic:

1.  Start your WebLogic Server an Login to the Admin Console.

2.  Create a JMS Server and File store.

JMS-1 Creating JMS Server
JMS-2Creating JMS Server-1
JMS-3Selecting JMS Server Store Type
JMS-4Configuring JMS Store
JMS-5Choosing JMS Store for JMS Server
JMS-6Targeting to the JMS Server

3.  Configuring JMS Module

JMS_M-1Creating JMS Module
JMS_M-2Entering JMS Module Name
JMS_M-3Targeting JMS Module

JMS_M-4Finishing the Module Creation

4.  Creating Connection Factory

JMS_C-1Creating JMS Connection Factory
JMS_C-2Selecting Connection Factory to be Created
JMS_C-3Creating the Connection Factory

JMS_C-4Targeting the Connection Factory

5.  Creating Sub-Deployment

JMS_Sub-1Creating Sub-Deployment
JMS_Sub-2Creating the Sub Deployment

JMS_Sub-3

Targeting the Sub-Deployment

6.  Creating a Topic

JMS_T-1Creating Topic
JMS_T-2Selecting Topic
JMS_T-3Providing Name/JNDIName to the Topic
JMS_T-4Targeting the Distributed Queue with the Sub-Topic

7.  Creating Durable Subscriptions

JMS_DS-1Selecting T-1
JMS_DS-2Creating Durable subscriber
JMS_DS-3Providing Subscription Name / Client ID for the Durable Subscriber

XML file sinp-codes

– config.xml


<jms-server>
	<name>JMS Server-1</name>
	<target>MS-1</target>
	<persistent-store>FileStore-1</persistent-store>
</jms-server>
<migratable-target>
	<name>MS-1 (migratable)</name>
	<notes>This is a system generated default migratable target for a server. Do not delete manually.</notes>
	<user-preferred-server>MS-1</user-preferred-server>
	<constrained-candidate-server />
	<cluster>Cluster</cluster>
	<migration-policy>manual</migration-policy>
	<post-script-failure-fatal>true</post-script-failure-fatal>
	<non-local-post-allowed>false</non-local-post-allowed>
	<restart-on-failure>false</restart-on-failure>
	<seconds-between-restarts>30</seconds-between-restarts>
	<number-of-restart-attempts>6</number-of-restart-attempts>
</migratable-target>
<file-store>
	<name>FileStore-1</name>
	<directory>c:/JMSStore/FileStore-1</directory>
	<target>MS-1</target>
</file-store>
<jms-system-resource>
	<name>MySystemModule-1</name>
	<target>MS-1</target>
	<sub-deployment>
		<name>Sub_Topic</name>
		<target>JMS Server-1</target>
	</sub-deployment>
	<descriptor-file-name>jms/mysystemmodule-1-jms.xml</descriptor-file-name>
</jms-system-resource>

– mysystemmodule-1-jms.xml


<connection-factory name="CF">
	<default-targeting-enabled>true</default-targeting-enabled>
	<jndi-name>CF</jndi-name>
	<security-params>
		<attach-jmsx-user-id>false</attach-jmsx-user-id>
	</security-params>
</connection-factory>
<topic name="T-1">
	<sub-deployment-name>Sub_Topic</sub-deployment-name>
	<jndi-name>T-1</jndi-name>
</topic>

Regards,

Ravish Mody

If you enjoyed this post, please considerleaving a comment or subscribing to the RSS feed to have future articles delivered to your feed reader.