glassfish
  1. glassfish
  2. GLASSFISH-19442

@JMSConnectionFactoryDefinition ignores clientId attribute

    Details

    • Type: Bug Bug
    • Status: Resolved
    • Priority: Major Major
    • Resolution: Fixed
    • Affects Version/s: 4.0_b47
    • Fix Version/s: 4.0_b71
    • Component/s: jms
    • Labels:
      None

      Description

      If I define a JMS connection factory using the following annotation:

      @JMSConnectionFactoryDefinition(
          name="java:global/jms/demoConnectionFactory",
          className= "javax.jms.ConnectionFactory",
          description="ConnectionFactory to use in demonstration",
          clientId="myClientID",
          resourceAdapterName="jmsra",
          user="guest",
          password="guest"
      )  
      

      then inject it into my session bean using:

          @Resource(lookup = "java:global/jms/demoConnectionFactory")
          ConnectionFactory connectionFactory;
      

      use it to create a connection

      Connection connection = connectionFactory.createConnection();
      

      and then report the clientid

      String clientId = connection.getClientID();
      System.out.println("ClientID = "+clientId);
      

      I get a value of null printed,

      However if I change the annotation to

      @JMSConnectionFactoryDefinition(
          name="java:global/jms/demoConnectionFactory",
          className= "javax.jms.ConnectionFactory",
          description="ConnectionFactory to use in demonstration",
          properties="clientId=myClientID",
          resourceAdapterName="jmsra",
          user="guest",
          password="guest"
      )     
      

      then the correct clientId is displayed.

      Both ways to configure clientId should work.

        Activity

        Hide
        Simon Meng added a comment -

        @JMSConnectionFactoryDefinition works fine. The root cause is in MQ, relative bug is MQ-270.

        Show
        Simon Meng added a comment - @JMSConnectionFactoryDefinition works fine. The root cause is in MQ, relative bug is MQ-270 .
        Hide
        Simon Meng added a comment -

        getClientID works fine with the reporter provide sample.
        How to get the CTS code and run it? I need check the failed case.

        Show
        Simon Meng added a comment - getClientID works fine with the reporter provide sample. How to get the CTS code and run it? I need check the failed case.
        Hide
        saradak added a comment -

        Reopening the bug as test is still failing with latest glassfish build(b-71)after the fix.

        CTS test(Client_checkClientIDOnDurableConnFactoryTest) failed at getting client id that is defined in the annotation for the
        connection factory. This fixed the descriptor version but not the annotation version.

        -Sarada

        Show
        saradak added a comment - Reopening the bug as test is still failing with latest glassfish build(b-71)after the fix. CTS test(Client_checkClientIDOnDurableConnFactoryTest) failed at getting client id that is defined in the annotation for the connection factory. This fixed the descriptor version but not the annotation version. -Sarada
        Hide
        Simon Meng added a comment -

        Fixed at revision 57972.

        Show
        Simon Meng added a comment - Fixed at revision 57972.
        Hide
        Nigel Deakin added a comment -

        I would suggest processing the "properties" attribute after the other attributes.

        Show
        Nigel Deakin added a comment - I would suggest processing the "properties" attribute after the other attributes.
        Hide
        Simon Meng added a comment - - edited
        @JMSConnectionFactoryDefinition(
            name="java:global/jms/demoConnectionFactory",
            className= "javax.jms.ConnectionFactory",
            description="ConnectionFactory to use in demonstration",
            clientId="myClientIDAttribute",
            properties="clientId=myClientIDProperty",
            resourceAdapterName="jmsra",
            user="guest",
            password="guest"
        )    
        

        If clientId is defined in both annotation attribute and property list, which one takes effect?

        Show
        Simon Meng added a comment - - edited @JMSConnectionFactoryDefinition( name="java:global/jms/demoConnectionFactory", className= "javax.jms.ConnectionFactory", description="ConnectionFactory to use in demonstration", clientId="myClientIDAttribute", properties="clientId=myClientIDProperty", resourceAdapterName="jmsra", user="guest", password="guest" ) If clientId is defined in both annotation attribute and property list, which one takes effect?

          People

          • Assignee:
            Simon Meng
            Reporter:
            Nigel Deakin
          • Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved: