activemq-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Jason Sherman (JIRA)" <j...@apache.org>
Subject [jira] [Commented] (AMQ-4717) populateJMSXUserID is not setting the JMSXUserID property on the JMS message in JMX
Date Tue, 10 Sep 2013 16:44:51 GMT

    [ https://issues.apache.org/jira/browse/AMQ-4717?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13763188#comment-13763188
] 

Jason Sherman commented on AMQ-4717:
------------------------------------

After looking into this further it appears the JMSXUserID is added to the JMS message however:

1) It is not visible when browsing the message via JMX

2) The Message.propertyExists(String s) does not detect that the property is actually there.

Using message.getStringProperty("JMSXUserID") will return the value if the property is set.

The following method was used to test this:

        private void browse() throws Exception
	{
		ActiveMQConnectionFactory connectionFactory = new ActiveMQConnectionFactory(user, password,
url);
        Connection connection = connectionFactory.createConnection();
		connection.start();
		
		Session session = connection.createSession(transacted, ackMode);

        Queue queue = session.createQueue(subject);

		QueueBrowser queueBrowser = session.createBrowser(queue);
        Enumeration enumeration = queueBrowser.getEnumeration();
        int received = 0;
        while (enumeration.hasMoreElements()) {
            Message message = (Message) enumeration.nextElement();

            System.out.println("Browsing message " + received+": "+message.getJMSMessageID());

            Enumeration propertyEnum = message.getPropertyNames();
            while(propertyEnum.hasMoreElements())
            {
                  System.out.println("Found: [" + propertyEnum.nextElement() + "]");
            }

            System.out.println("JMSXUserID: " + message.getStringProperty("JMSXUserID"));

            if(message.propertyExists("JMSXUserID")){
				System.out.println("JMSXUserID Exists");
			}
			else{
				System.out.println("JMSXUserID Not Found!");
            }

	    }
      }

Which prints:

Browsing message 0: ID:fusepro.home-63724-1378830280448-1:1:1:1:1
Found: [JMSXUserID]
JMSXUserID: admin
JMSXUserID Not Found!


                
> populateJMSXUserID is not setting the JMSXUserID property on the JMS message in JMX
> -----------------------------------------------------------------------------------
>
>                 Key: AMQ-4717
>                 URL: https://issues.apache.org/jira/browse/AMQ-4717
>             Project: ActiveMQ
>          Issue Type: Bug
>    Affects Versions: 5.5.1, 5.6.0, 5.8.0
>         Environment: OSX
> java version "1.7.0_25"
>            Reporter: Jason Sherman
>            Assignee: Hiram Chirino
>              Labels: authentication
>             Fix For: 5.9.0
>
>
> When setting the attribute populateJMSXUserID="true" as documented [1] the broker should
populate the JMS message with the JMSXUserID property.  However, this is not the case.  
> I have configured the broker to require authentication and sent a message to a Queue
using the JMS producer shipped with the distribution.  The message is then inspected via JMX
and the JMSXUserID property is not set.
> [1] http://activemq.apache.org/jmsxuserid.html

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators
For more information on JIRA, see: http://www.atlassian.com/software/jira

Mime
View raw message