3 Replies Latest reply on Jan 20, 2011 3:09 PM by martin.hynar

    Dynamically provide user and password for MDB

    shadow2000

      Hi everyone,

      we have a huge problem over here and I'm wondering if somebody else have solved this problem.

      We have developed a application on JBoss 4.2.3 with MDBs that listen to queue provided by a remote provider. Everthing works fine but the queues needed a user. the only solution that i have found is to define user and password with annotations:

      
      @MessageDriven(name = "IncomingSupplierOrderListener", activationConfig = {
       @ActivationConfigProperty(propertyName = "destinationType", propertyValue = "javax.jms.Topic"),
       @ActivationConfigProperty(propertyName = "destination", propertyValue = "topic/TOPICNAME"),
       @ActivationConfigProperty(propertyName = "subscriptionDurability", propertyValue = "NonDurable"),
       @ActivationConfigProperty(propertyName = "providerAdapterJNDI", propertyValue = "java:/Remote_JMSProvider"),
       @ActivationConfigProperty(propertyName = "user", propertyValue = MessageConstants.INCOMING_USER),
       @ActivationConfigProperty(propertyName = "password", propertyValue = MessageConstants.INCOMING_USER_PASS),
       @ActivationConfigProperty(propertyName = "acknowledgeMode", propertyValue = "AUTO_ACKNOWLEDGE/Auto-acknowledge") })


      Both are set over constants. But we need to change these settings on runtime. Have anybody an idea how to solve this?

      Best Regards
      Lars

        • 1. Re: Dynamically provide user and password for MDB
          jaikiran

           

          @ActivationConfigProperty(propertyName = "user", propertyValue = MessageConstants.INCOMING_USER),
          @ActivationConfigProperty(propertyName = "password", propertyValue = MessageConstants.INCOMING_USER_PASS),


          These can be configured through the deployment descriptors instead.

          But we need to change these settings on runtime.


          Configuring through deployment descriptors would be a "deployment" time change. Are you looking for a deployment time setting or do you really mean a runtime setting?

          • 2. Re: Dynamically provide user and password for MDB
            shadow2000

            Hi,

            thanks for your reply.

            On deployment time is much better than on compile time. I've found some short description about doing it with deployment descriptors but no full example and everything i tried failed.

            Could you give some hints or an example?

            Greets
            Lars

            • 3. Dynamically provide user and password for MDB
              martin.hynar

              Hi Lars,

               

              have you somehow managed to change user/password in runtime, or is deployment time configuration the latest possible option? I am solvin the same problem, so your experience is really appreciated.

               

              br, Martin