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

          People

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

            Dates

            • Created:
              Updated:
              Resolved: