Return-Path: Delivered-To: apmail-activemq-users-archive@www.apache.org Received: (qmail 41432 invoked from network); 9 Nov 2009 00:28:22 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (140.211.11.3) by minotaur.apache.org with SMTP; 9 Nov 2009 00:28:22 -0000 Received: (qmail 57013 invoked by uid 500); 9 Nov 2009 00:28:22 -0000 Delivered-To: apmail-activemq-users-archive@activemq.apache.org Received: (qmail 56950 invoked by uid 500); 9 Nov 2009 00:28:21 -0000 Mailing-List: contact users-help@activemq.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: users@activemq.apache.org Delivered-To: mailing list users@activemq.apache.org Received: (qmail 56940 invoked by uid 99); 9 Nov 2009 00:28:21 -0000 Received: from nike.apache.org (HELO nike.apache.org) (192.87.106.230) by apache.org (qpsmtpd/0.29) with ESMTP; Mon, 09 Nov 2009 00:28:21 +0000 X-ASF-Spam-Status: No, hits=-0.0 required=10.0 tests=SPF_HELO_PASS,SPF_PASS X-Spam-Check-By: apache.org Received-SPF: pass (nike.apache.org: domain of lists@nabble.com designates 216.139.236.158 as permitted sender) Received: from [216.139.236.158] (HELO kuber.nabble.com) (216.139.236.158) by apache.org (qpsmtpd/0.29) with ESMTP; Mon, 09 Nov 2009 00:28:11 +0000 Received: from isper.nabble.com ([192.168.236.156]) by kuber.nabble.com with esmtp (Exim 4.63) (envelope-from ) id 1N7I6o-00020s-QR for users@activemq.apache.org; Sun, 08 Nov 2009 16:27:50 -0800 Message-ID: <26259578.post@talk.nabble.com> Date: Sun, 8 Nov 2009 16:27:50 -0800 (PST) From: hackingbear To: users@activemq.apache.org Subject: Network broker and filter predicate MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit X-Nabble-From: hackingbear@gmail.com X-Virus-Checked: Checked by ClamAV on apache.org Hi, In our setup, we have a backbone broker running the verbatim AMQ 5.3 and a 5.3 broker without our own BrokerFilter (gateway broker.) The gateway broker is for serving clients connecting from the Internet. One thing the broker does is to ensure only the right messages can be consumed, like: public Subscription addConsumer(ConnectionContext context, ConsumerInfo info) throws Exception { PropertyExpression filterProp = new PropertyExpression("FILTER_VALUE"); List elements = Arrays.asList("A", "B", "C", "D"); BooleanExpression predicate = ComparisonExpression.createInFilter(filterProp, elements); info.setAdditionalPredicate(predicate); The config file is currently very simple: Then when the filter code runs, I will get an exception shown below, which also seems to throw the gateway broker in disarray as it keeps trying the same thing with same errors. If I comment out the setaddtionalPredicate(), the error goes away. Looking around the AMQ codes, the boolean/unary expressions indeed do not implement the DataStructure and this marshaller indeed is trying to cast to DataStructure. Further, SimpleAuthorizationBroker just instantiates a BooleanExpression. So I wonder if this has to do with network broker setup. How can I fix/work around this problem? Greatly appreciate for any help!! ---- WARN DemandForwardingBridge Caught an exception processing local command [@BrokerService] 2009-11-08 15:22:40,877 java.lang.ClassCastException: org.apache.activemq.filter.UnaryExpression$2 cannot be cast to org.apache.activemq.command.DataStructure at org.apache.activemq.openwire.v3.ConsumerInfoMarshaller.tightMarshal1(ConsumerInfoMarshaller.java:127) at org.apache.activemq.openwire.OpenWireFormat.tightMarshalNestedObject1(OpenWireFormat.java:397) at org.apache.activemq.openwire.v3.BaseDataStreamMarshaller.tightMarshalNestedObject1(BaseDataStreamMarshaller.java:131) at org.apache.activemq.openwire.v3.MessageMarshaller.tightMarshal1(MessageMarshaller.java:132) at org.apache.activemq.openwire.v3.ActiveMQMessageMarshaller.tightMarshal1(ActiveMQMessageMarshaller.java:77) at org.apache.activemq.openwire.OpenWireFormat.marshal(OpenWireFormat.java:228) at org.apache.activemq.transport.tcp.TcpTransport.oneway(TcpTransport.java:166) at org.apache.activemq.transport.InactivityMonitor.oneway(InactivityMonitor.java:233) at org.apache.activemq.transport.TransportFilter.oneway(TransportFilter.java:83) at org.apache.activemq.transport.WireFormatNegotiator.oneway(WireFormatNegotiator.java:100) at org.apache.activemq.transport.MutexTransport.oneway(MutexTransport.java:40) at org.apache.activemq.transport.ResponseCorrelator.oneway(ResponseCorrelator.java:60) at org.apache.activemq.network.DemandForwardingBridgeSupport.serviceLocalCommand(DemandForwardingBridgeSupport.java:647) at org.apache.activemq.network.DemandForwardingBridgeSupport$1.onCommand(DemandForwardingBridgeSupport.java:147) at org.apache.activemq.transport.ResponseCorrelator.onCommand(ResponseCorrelator.java:104) at org.apache.activemq.transport.TransportFilter.onCommand(TransportFilter.java:68) at org.apache.activemq.transport.vm.VMTransport.oneway(VMTransport.java:113) at org.apache.activemq.transport.MutexTransport.oneway(MutexTransport.java:40) at org.apache.activemq.transport.ResponseCorrelator.oneway(ResponseCorrelator.java:60) at org.apache.activemq.broker.TransportConnection.dispatch(TransportConnection.java:1207) at org.apache.activemq.broker.TransportConnection.processDispatch(TransportConnection.java:793) at org.apache.activemq.broker.TransportConnection.iterate(TransportConnection.java:830) at org.apache.activemq.thread.PooledTaskRunner.runTask(PooledTaskRunner.java:122) at org.apache.activemq.thread.PooledTaskRunner$1.run(PooledTaskRunner.java:43) at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:886) at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:908) at java.lang.Thread.run(Thread.java:619) -- View this message in context: http://old.nabble.com/Network-broker-and-filter-predicate-tp26259578p26259578.html Sent from the ActiveMQ - User mailing list archive at Nabble.com.