Monday May 26, 2014

How to create a JMS durable subscriber in WebLogic Server?

WebLogic Server Provides a set of examples that are very helpful to get started with Weblogic Server

Here you can check how to install the examples:
http://docs.oracle.com/cd/E23943_01/doc.1111/e14142/prepare.htm


After you have installed the examples, you can find the example you want to review, in this case TopicReceive, here:

wlserver_10.3/samples/server/examples/src/examples/jms/topic

To review details of the specific example, you can open:

wlserver_10.3/samples/server/examples/src/examples/jms/topic/instructions.html

To create a Durable Subscriber, you can just set the client ID  and invoke createDurableSubscriber instead of calling createSubscriber, i.e.:

   tconFactory = (TopicConnectionFactory)
      PortableRemoteObject.narrow(ctx.lookup(JMS_FACTORY),
                                  TopicConnectionFactory.class);
    tcon = tconFactory.createTopicConnection();
    //Set Client ID for this Durable Subscriber
    tcon.setClientID("GT2");
    tsession = tcon.createTopicSession(false, Session.AUTO_ACKNOWLEDGE);
    topic = (Topic)
      PortableRemoteObject.narrow(ctx.lookup(topicName),
                                  Topic.class);
    // Create Durable Subscription
    tsubscriber = tsession.createDurableSubscriber(topic, "Test");
    tsubscriber.setMessageListener(this);
    tcon.start();



Enjoy!  

You can read more about this here:
http://docs.oracle.com/cd/E23943_01/web.1111/e13727/advpubsub.htm#CHDEBABC
http://docs.oracle.com/cd/E23943_01/web.1111/e13727/manage_apps.htm#i1097671    
http://docs.oracle.com/cd/E23943_01/apirefs.1111/e13943/WebLogic.Messaging.ISession.CreateDurableSubscriber_overload_2.html

Tuesday May 06, 2014

How to delete a JDBC Store?

If you see the message "Skipping unexpected null message encountered on store boot", you will need to recreate your JDBC store, because it got corrupted.

You will see a message like this in the weblogic server log:
<Warning> <Messaging> <BEA-282013> <Skipping unexpected null message encountered on store boot, [ sequence=4862 queue=12 name=MyModule!MyQueue state=0 deliveryCount=2 ]>

Steps to fix the issue:
1. Make sure managed server is not running

2.  Delete the corrupted JDBC store because messages are corrupted.

See Managing JDBC Store Tables

http://docs.oracle.com/cd/E23943_01/web.1111/e13701/store.htm#i1143431

e.g.:
If you have provided the prefix MY when you created your JDBC store, your table is named MYWLStore, otherwise, it is just named WLStore

To drop the table, you can use the option below or simply drop it using a database tool:

$ echo "drop MYWLStore;" > drop.ddl
$ cd <YourDomain>/bin
$. ./setDomainEnv.sh
  **Notice the . before ./
$ java utils.Schema jdbc:weblogic:oracle:DEMO weblogic.jdbc.oci.Driver -u user1 -p foobar \
  -verbose drop.ddl

3. Start managed server. The store table will be recreated when managed server is started

Enjoy!
About


My name is Luz Mestre. I work as Principal Technical Support Engineer at Oracle Support. I'll post here the most interesting challenges I have in my daily work. The views expressed on this blog are my own and do not necessarily reflect the views of Oracle.

Search

Categories
Archives
« May 2014 »
SunMonTueWedThuFriSat
    
1
2
3
4
5
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
27
28
29
30
31
       
Today