0 Replies Latest reply on Feb 24, 2014 2:43 PM by 1b9c370d-a38e-46aa-bd79-94717c9d85c6

    Non durable MDB in weblogic cluster

    1b9c370d-a38e-46aa-bd79-94717c9d85c6

      Hi,

       

      I have a MDB deployed on 2 weblogic managed servers within a cluster. The MDB is subscribed to Sonic ESB topic. Currently, the MDB processes message from topic on both the nodes i.e. the message are processed twice by each MDB. It should only be processed once. I have seen elsewhere in this forum that one way to resolve this is to set client id, but this works only for durable subscriptions. I cannot make mine durable. So I have to make this work on non-durable subscription.

       

      What is the common way of addressing this problem?

       

      In another post someone had suggested setting the connection-id for the connection factory. Can someone help me with the code as to how to set the connection-id in connection factory? How can I get the foreign connection factory instance within MDB and change its properties? I tried as below, but it doesn't seem to set the connect id at all. Any help is most appreciated!

       

      TopicConnectionFactory qcf;

          TopicConnection conn;

       

       

          @PostConstruct

          public void initialise() {

       

       

              try {

                  InitialContext ctx = new InitialContext();

                  if(qcf == null)

                      qcf = (TopicConnectionFactory) ctx.lookup("local/LHRTCFFLT");

                  qcf.setConnectID("DOT_FLTPUB");

                  conn = qcf.createTopicConnection();

                  conn.start();

              } catch (JMSException e) {

                  logger.error("Error in connection");

              } catch (NamingException e) {

                  logger.error("Error in setting connection id");

              }

          }