Return-Path: Delivered-To: apmail-activemq-dev-archive@www.apache.org Received: (qmail 94261 invoked from network); 31 Mar 2011 10:40:54 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (140.211.11.3) by minotaur.apache.org with SMTP; 31 Mar 2011 10:40:54 -0000 Received: (qmail 33514 invoked by uid 500); 31 Mar 2011 10:40:53 -0000 Delivered-To: apmail-activemq-dev-archive@activemq.apache.org Received: (qmail 33468 invoked by uid 500); 31 Mar 2011 10:40:53 -0000 Mailing-List: contact dev-help@activemq.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: dev@activemq.apache.org Delivered-To: mailing list dev@activemq.apache.org Received: (qmail 33424 invoked by uid 99); 31 Mar 2011 10:40:53 -0000 Received: from nike.apache.org (HELO nike.apache.org) (192.87.106.230) by apache.org (qpsmtpd/0.29) with ESMTP; Thu, 31 Mar 2011 10:40:53 +0000 X-ASF-Spam-Status: No, hits=-2000.0 required=5.0 tests=ALL_TRUSTED,T_RP_MATCHES_RCVD X-Spam-Check-By: apache.org Received: from [140.211.11.116] (HELO hel.zones.apache.org) (140.211.11.116) by apache.org (qpsmtpd/0.29) with ESMTP; Thu, 31 Mar 2011 10:40:50 +0000 Received: from hel.zones.apache.org (hel.zones.apache.org [140.211.11.116]) by hel.zones.apache.org (Postfix) with ESMTP id 66D0D8B028 for ; Thu, 31 Mar 2011 10:40:12 +0000 (UTC) Date: Thu, 31 Mar 2011 10:40:12 +0000 (UTC) From: "Dejan Bosanac (JIRA)" To: dev@activemq.apache.org Message-ID: <1675931733.24044.1301568012417.JavaMail.tomcat@hel.zones.apache.org> In-Reply-To: <407190273.17270.1301339105872.JavaMail.tomcat@hel.zones.apache.org> Subject: [jira] [Commented] (AMQ-3245) SELECTORS doesn't work for releases 5.4.0 to current MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit X-JIRA-FingerPrint: 30527f35849b9dde25b450d4833f0394 X-Virus-Checked: Checked by ClamAV on apache.org [ https://issues.apache.org/jira/browse/AMQ-3245?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13013911#comment-13013911 ] Dejan Bosanac commented on AMQ-3245: ------------------------------------ Hi, your problem isn't related to page size but the small memory limit on the queue. Because of this small limit only portion of messages (22 to be precise) can be cached in the queue and while those messages aren't consumed others can't get in from the store. So use some higher value for memory limit and you'd be fine. > SELECTORS doesn't work for releases 5.4.0 to current > ---------------------------------------------------- > > Key: AMQ-3245 > URL: https://issues.apache.org/jira/browse/AMQ-3245 > Project: ActiveMQ > Issue Type: Bug > Components: Selector > Affects Versions: 5.4.1, 5.4.2 > Reporter: Melvin Ramos > Attachments: ActiveMQ_Test_Case.txt, JmsTestConsumer1.java, JmsTestProducer1.java, activemq.xml > > > Is it possible that selector was broken due to new enhancement regarding REST selectors on 5.4.0? We are using 5.3.0 and selectors are working fine, however since we've upgraded our demo and test environments to 5.4.1 and essentially 5.4.2 it stop working for some reason. I can recreate it 100% of the time and below are the steps. > 1) First create the producer with String property set to 30. i.e. test, 30: > {code} > String username="Me" > String passwd = "invicible" > String url ="failover:(tcp://localhost:51515)?maxReconnectDelay=5000&useExponentialBackOff=false"; > ConnectionFactory connectionFactory = new ActiveMQConnectionFactory(username, passwd, url); > Connection connection = connectionFactory.createConnection(); > // connection.setUseCompression(true); set this on the URL instead > connection.setExceptionListener(this); > String destinationString = "Test.Dest"; > // create a session, destination, and producer > Session session = connection.createSession(false, Session.AUTO_ACKNOWLEDGE); > Destination destination = session.createQueue(destinationString); > MessageProducer producer = session.createProducer(destination); > producer.setDeliveryMode(DeliveryMode.PERSISTENT); > Message message = session.createTextMessage("This is a test message"); > message.setIntProperty("test", 30); > // insert the message 1000 times. > for (long l = 0L; l < 1000; l++) { > producer.send(message); > } > producer.close(); > session.close(); > connection.close(); > {code} > Now we have 1000 message sitting on activemq, if you navigate to http://localhost:8161/admin and view "Test.Dest" queue you should see the 1000 message there. > 2) Create the consumer with test > 50 selector. > {code} > public void setup() { > String username="Me" > String passwd = "invicible" > String url ="failover:(tcp://localhost:51515)?maxReconnectDelay=5000&useExponentialBackOff=false"; //"tcp://localhost:51515"; > ConnectionFactory connectionFactory = new ActiveMQConnectionFactory(username, passwd, url); > Connection connection = connectionFactory.createConnection(); > // connection.setUseCompression(true); set this on the URL instead > connection.setExceptionListener(this); > // create a session, destination, and consumer > Session session = connection.createSession(false, Session.CLIENT_ACKNOWLEDGE); > String destinationString = "Test.Dest"; > session.createQueue(destinationString); > MessageConsumer consumer = session.createConsumer(destination, "test > 50"); > consumer.setMessageListener(this); > connection.start(); > } > public void onMessage(Message message) { > try { > if (print && text) { > TextMessage textMessage = (TextMessage) message; > System.out.println(textMessage.getText()); > } > catch (Exception ex) > { //swallow } > } > {code} > Once connected to broker, you'll see that it doesn't do anything as the message is not for this selector. > 3) Edit the code to producer. > {code} > message.setIntProperty("test", 60); > {code} > And then rerun the producer to insert the 1000 records again. > Actual: Nothing happens, the consumer just waits for any message that comes in that matches the selector. > Expected: The message gets consumed, as the latter part of the producer ran matches the selector. > This behavior works perfectly fine with 5.3.0. As selector is an important functionality of JMS as a whole this being broken is actually bad. -- This message is automatically generated by JIRA. For more information on JIRA, see: http://www.atlassian.com/software/jira