14 Replies Latest reply: Feb 26, 2013 4:09 AM by 704638 RSS

    How to save durable subscription of the OSB jms proxy service?

    790184
      Hi there,

      Is it possible to save durable subscription of the OSB jms proxy service when undeploying an application and how?

      Regards,
      Sergey
        • 1. Re: How to save durable subscription of the OSB jms proxy service?
          742942
          Hi,

          I the OSB Console, under system administration theres an option for "Create Customization File" .
          I think this is something you are looking for.
          • 2. Re: How to save durable subscription of the OSB jms proxy service?
            790184
            Customization file does not allow to configure any preferences for durable subscriptions as far as I know. I have already investigated it.
            • 3. Re: How to save durable subscription of the OSB jms proxy service?
              742942
              Ok..

              Can you please elaborate your scenario for us. I think that might help..
              • 4. Re: How to save durable subscription of the OSB jms proxy service?
                790184
                I have an osb configuration with one jms proxy service and one business service. Jms service listens to a topic. In the configuration of the jms proxy service I have set "durable subscription" checkbox. Now I have to save durable subscription when configuration is completely undeployed. It seems that MDBs unsibscribe when undeploying an application.
                • 5. Re: How to save durable subscription of the OSB jms proxy service?
                  742942
                  Hi,

                  You dont need to explicitly save the durable sunbscrition.
                  Whenever you check the Durable Subscriber check box, it tells the JMS server that your proxy is a Durable Subscriber to the topic you configured.
                  This only means that if the durable subscriber is inactive(undeployed in your case)JMS will keep the message until the subscriber is active.(or ofcourse until topic message expiry time hsa elapsed).

                  A durable subscriber registers a durable subscription with a unique identity that is retained by JMS. Subsequent subscriber objects with the same identity resume the subscription in the state it was left by the prior subscriber. If there is no active subscriber for a durable subscription, JMS retains the subscription's messages until they are received by the subscription or until they expire.

                  I hope this helps.

                  Cheers,
                  Hrishi
                  • 6. Re: How to save durable subscription of the OSB jms proxy service?
                    790184
                    Hrishi, thanks for your help.

                    I understand how durable subscription works, but maybe I'm not clear enough. When deploying configuration, osb generates ear artefact for my jms proxy service and it can be accessed by means of the "Deployments" section in the weblogic administrative console. There is ejb.jar inside this artefact, and inside the ejb.jar/META-INF there is weblogic-ejb-jar.xml which look like this:
                    <?xml version='1.0' encoding='UTF-8'?>
                    <web:weblogic-ejb-jar xmlns:web="http://xmlns.oracle.com/weblogic/weblogic-ejb-jar">
                      <web:weblogic-enterprise-bean>
                        <web:ejb-name>RequestEJB-2142434440308182001-35b5fbc.12acd76991c.-7f10</web:ejb-name>
                        <web:message-driven-descriptor>
                          <web:pool>
                            <web:max-beans-in-free-pool>1000</web:max-beans-in-free-pool>
                            <web:initial-beans-in-free-pool>1</web:initial-beans-in-free-pool>
                          </web:pool>
                          <web:destination-jndi-name>TefTopicLocal1</web:destination-jndi-name>
                          <web:provider-url>t3://host1,host2</web:provider-url>
                          <web:connection-factory-jndi-name>TefConnectionFactoryLocal</web:connection-factory-jndi-name>
                          <web:generate-unique-jms-client-id>true</web:generate-unique-jms-client-id>
                          <web:durable-subscription-deletion>true</web:durable-subscription-deletion>
                        </web:message-driven-descriptor>
                        <web:transaction-descriptor>
                          <web:trans-timeout-seconds>600</web:trans-timeout-seconds>
                        </web:transaction-descriptor>
                        <web:resource-description>
                          <web:res-ref-name>jms/ConnectionFactory</web:res-ref-name>
                          <web:jndi-name>TefConnectionFactoryLocal</web:jndi-name>
                        </web:resource-description>
                        <web:resource-description>
                          <web:res-ref-name>jms/TopicName</web:res-ref-name>
                          <web:jndi-name>TefTopicLocal1</web:jndi-name>
                        </web:resource-description>
                      </web:weblogic-enterprise-bean>
                      <web:disable-warning>BEA-010001</web:disable-warning>
                      <web:disable-warning>BEA-010054</web:disable-warning>
                      <web:disable-warning>BEA-010200</web:disable-warning>
                      <web:disable-warning>BEA-010202</web:disable-warning>
                    </web:weblogic-ejb-jar>
                    As you can see there are generate-unique-jms-client-id and durable-subscription-deletion tags whose values are "true". In such a case when I undeploy my osb configuration my durable subscription will be lost due to
                    <web:durable-subscription-deletion>true</web:durable-subscription-deletion>
                    When I deploy a new configuration, new clientId for the durable subscription will be generated due to
                    <web:generate-unique-jms-client-id>true</web:generate-unique-jms-client-id>
                    and there is no guarantee that this clientId will be the same as in the previous deployment.

                    I don't like to redeploy ear artefact with custom deployment plan, because its rather unclear. Moreover name of ear and name of ejb, that corresponds to the jms proxy service, is new every time I deploy my application and I have to create new deployment plan on every new deployment.

                    Regards,
                    Sergey
                    • 7. Re: How to save durable subscription of the OSB jms proxy service?
                      742942
                      Hi Sergey,

                      I got your scenario now.

                      have you tried setting the
                      <web:generate-unique-jms-client-id>true</web:generate-unique-jms-client-id>
                      as false?...

                      I think this might enable you to use the previously generated unique ids even after u undeploy the OSB configuration.

                      One more thing il like to add..which i have tried.

                      I created a JMS Topic then i created an OSB proxy which subscribes to this topic. Then i undeployed my proxy and redeployed it. After the redeployment i could subscribe the messages published on the topic in my redeployed prxy.

                      So, i think this is something you must be looking for, as far as i understood.

                      One more thing..I could find the ear artifact of the osb proxy that u mentioned in you reply. Could please tell me where it exaclty is?
                      • 8. Re: How to save durable subscription of the OSB jms proxy service?
                        790184
                        Hi, Hrishi

                        The OSB's ear artefact for the proxy service is located under $DOMAIN_HOME/sbgen directory. In my case its name was something like that ALSBXXXXXXXXXXXXX.ear, where each X is a digit.
                        have you tried setting the
                        <web:generate-unique-jms-client-id>true</web:generate-unique-jms-client-id>
                        as false?...

                        I think this might enable you to use the previously generated unique ids even after u undeploy the OSB configuration.
                        I have tried to redeploy generated artefact with the following deployment plan:
                        <?xml version='1.0' encoding='UTF-8'?>
                        <deployment-plan xmlns="http://xmlns.oracle.com/weblogic/deployment-plan" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://xmlns.oracle.com/weblogic/deployment-plan http://xmlns.oracle.com/weblogic/deployment-plan/1.0/deployment-plan.xsd">
                          <application-name>_ALSB_1283426858152</application-name>
                        
                            <variable-definition>
                                <variable>
                                    <name>durableSubscriptionDeletion</name>
                                    <value>false</value>
                                </variable>
                                <variable>
                                    <name>maxBeansInFreePool</name>
                                    <value>1</value>
                                </variable>
                                <variable>
                                    <name>jmsClientId</name>
                                    <value>SYSTEM_D</value>
                                </variable>
                                <variable>
                                    <name>generateUniqueJmsClientId</name>
                                    <value>false</value>
                                </variable>
                          </variable-definition>
                        
                          <module-override>
                            <module-name>_ALSB_1283426858152.ear</module-name>
                            <module-type>ear</module-type>
                            <module-descriptor external="false">
                              <root-element>weblogic-application</root-element>
                              <uri>META-INF/weblogic-application.xml</uri>
                            </module-descriptor>
                            <module-descriptor external="false">
                              <root-element>application</root-element>
                              <uri>META-INF/application.xml</uri>
                            </module-descriptor>
                            <module-descriptor external="true">
                              <root-element>wldf-resource</root-element>
                              <uri>META-INF/weblogic-diagnostics.xml</uri>
                            </module-descriptor>
                          </module-override>
                          
                          <module-override>
                            <module-name>ejb.jar</module-name>
                            <module-type>ejb</module-type>
                            <module-descriptor external="false">
                              <root-element>weblogic-ejb-jar</root-element>
                              <uri>META-INF/weblogic-ejb-jar.xml</uri>
                                    <variable-assignment>
                                        <name>durableSubscriptionDeletion</name>
                                        <xpath>/weblogic-ejb-jar/weblogic-enterprise-bean/[ejb-name="RequestEJB-2142434440308182001-35b5fbc.12acd76991c.-7f10"]/message-driven-descriptor/durable-subscription-deletion</xpath>
                                        <operation>replace</operation>
                                    </variable-assignment>
                                    <variable-assignment>
                                        <name>maxBeansInFreePool</name>
                                        <xpath>/weblogic-ejb-jar/weblogic-enterprise-bean/[ejb-name="RequestEJB-2142434440308182001-35b5fbc.12acd76991c.-7f10"]/message-driven-descriptor/pool/max-beans-in-free-pool</xpath>
                                        <operation>replace</operation>
                                    </variable-assignment>
                                    <variable-assignment>
                                        <name>jmsClientId</name>
                                        <xpath>/weblogic-ejb-jar/weblogic-enterprise-bean/[ejb-name="RequestEJB-2142434440308182001-35b5fbc.12acd76991c.-7f10"]/message-driven-descriptor/jms-client-id</xpath>
                                        <operation>replace</operation>
                                    </variable-assignment>
                                    <variable-assignment>
                                        <name>generateUniqueJmsClientId</name>
                                        <xpath>/weblogic-ejb-jar/weblogic-enterprise-bean/[ejb-name="RequestEJB-2142434440308182001-35b5fbc.12acd76991c.-7f10"]/message-driven-descriptor/generate-unique-jms-client-id</xpath>
                                        <operation>replace</operation>
                                    </variable-assignment>
                            </module-descriptor>
                            <module-descriptor external="false">
                              <root-element>ejb-jar</root-element>
                              <uri>META-INF/ejb-jar.xml</uri>
                            </module-descriptor>
                          </module-override>
                          
                          <config-root>/bea/domains/tef/osb/config/plan</config-root>
                        </deployment-plan>
                        In such a case I was able not to lose my subscription. But as I have mentioned I have to create new deployment plan every time I update my osb configuration.
                        I created a JMS Topic then i created an OSB proxy which subscribes to this topic. Then i undeployed my proxy and redeployed it. After the redeployment i could subscribe the messages published on the topic in my redeployed prxy.

                        So, i think this is something you must be looking for, as far as i understood.
                        Exactly. I have tried to update some params of my proxy service and redeploy the configuration with updated proxy service. In my case subscription has been lost. By the way I'm using weblogic 10.3.3.0 and osb 11.1.1.3.0.

                        Regards, Sergey
                        • 9. Re: How to save durable subscription of the OSB jms proxy service?
                          742942
                          Hey Sergey,

                          This is what i tried after your response.

                          On the Weblogic Console, i could see my proxy service as a subscriber of the topic i had created (in the JMS Topic->Monitoring->Durable Subscribers ) with client id

                          RequestEJB-8487172182546011448--38179c19.12ad1319f63.-7faf_OWSM_EXTN_AdminServer__ALSB_1283519846122ejb.jarRequestEJB-8487172182546011448--38179c19.12ad1319f63.-7faf

                          Then i undeployed my proxy service(i logged in on OSB Console and deleted the proxy service) and to no suprise, on the Weblogic console, the subsciption of the proxy service to the JMS topic was lost.

                          Then i redeployed the OSB config jar(by importing the saved jar though OSB console). Then on the weblogic console, i could see the subscription again with client id

                          RequestEJB-8487172182546011448--38179c19.12ad1319f63.-7fa3_OWSM_EXTN_AdminServer__ALSB_1283519938419ejb.jarRequestEJB-8487172182546011448--38179c19.12ad1319f63.-7fa3

                          (The client ids are different)

                          So the weblogic server is generating unique/different client id every time i redeploy the service with no changes at all.

                          what i get from all of this is that, if the subscriber is undeployed, the weblogic server comes to know about it and Weblogic server removes the durable subscription of that subscriber(which is now undeployed).

                          I think this is the way it works, may be its creating a overhead in your case, but If the subscriber itself is not available, then there is no use of unnecesarily keeping it in the durable subscriber list of theTopic and adding an extra over head.

                          I think this is the way it is designed and developed. Whenever you redeploy it, u get a new client id which differs from your previous client id for the same Service. But I dont think it should bother so much since, One is ultimately interested in getting the messages published on the topic and not how JMS internally manages durable subscribers.

                          But i agree to your point that since a new client id is generated every time, you are facing some issues in your deployment plan. But functianlaity wise i dont see any problem.

                          I havent tried deploying the service through a deployment plan(I have done deployment directly though the OSB console).

                          I think there should be some workaround of the same and wil surely look into it.
                          Il get back to you as soon as i get something.

                          Cheers,
                          Hrishi
                          • 10. Re: How to save durable subscription of the OSB jms proxy service?
                            790184
                            Hrishi, thank you very much for your help.
                            Then i undeployed my proxy service(i logged in on OSB Console and deleted the proxy service) and to no suprise, on the Weblogic console, the subsciption of the proxy service to the JMS topic was lost.
                            Moreover I was not able to save durable subscription when I tried to update my osb configuration without undeployment in case when some params of proxy service were changed. I think it's rather critical issue because it's almost impossible to update an application without losing messages.

                            Reagards, Sergey
                            • 11. Re: How to save durable subscription of the OSB jms proxy service?
                              675595
                              Yes. When ever the proxy is modified and activated, OSB creates a new artifact (read MDB with unique client id). So that is the crux of the problem.

                              1) client id changes when proxy is modified/updated.
                              2) Even if the client ID remains same, OSB uses un-deploy and deploy semantics and there will be small window (after un-deploy and before deploy) where the messages might get lost. I'm not aware if weblogic servers provides some API redeploy which allows this use-case even in standalone java (under investigation http://download-llnw.oracle.com/docs/cd/E12840_01/wls/docs103/jms/manage_apps.html#wp1097632).
                              3) I also foresee that in production that users might also want the delete operation behave similarly (we get a new version of sbconfig jar and when deployed it will delete the older version of proxy)

                              Please raise an enhancement request with support for this very valid use case.

                              Manoj
                              • 12. Re: How to save durable subscription of the OSB jms proxy service?
                                790184
                                Hi Manoj,

                                I have already raised a request on friday.

                                Regards,
                                Sergey
                                • 13. Re: How to save durable subscription of the OSB jms proxy service?
                                  742942
                                  Hi Sergey,

                                  So we see theres a bug.
                                  Good job that you raised a service request. Coool.
                                  Could you also send the info to me on my mail id. Itl be great. (My email id is there on my profile)

                                  Thanks man,
                                  Looking forward to working with you on more such issues.
                                  Cheers !
                                  • 14. Re: How to save durable subscription of the OSB jms proxy service?
                                    704638
                                    Hi there

                                    Did Oracle provide a patch for this and what is the bug ID / patch ID?
                                    I couldn't find any information in the knowledge base so far.

                                    Thanks for sharing information!

                                    Cheers
                                    Dani