activemq-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From kkarank <karan...@gmail.com>
Subject Re: Unable to have multiple consumers on the same broker
Date Thu, 16 Jul 2009 14:39:47 GMT

Hi All,

Thanks for your replies.

Here is the code I am trying to use - 

Client 1 - subscribing to messages on '/queue/testing1'
.....

        $this->con=new Stomp($host);
        // connect
        $this->con->connect();
        $this->con->subscribe('/queue/testing1'); 
.....

Client 2 - subscribing to messages on '/queue/testing2'
.....

        $this->con=new Stomp($host);
        // connect
        $this->con->connect();
        $this->con->subscribe('/queue/testing2'); 
.....

With this code, I am only able to connect EITHER clien1 or client2

Now I add the clientId property to both clients like so -

clien1 
  $this->con=new Stomp($host);
        // connect
        $this->con->clientId = 'client1';
        $this->con->connect();
        $this->con->subscribe('/queue/testing1'); 

client2
   $this->con=new Stomp($host);
        // connect
         $this->con->clientId = 'client2';
        $this->con->connect();
        $this->con->subscribe('/queue/testing1'); 

still i can only start one client at a time. The exception is get in apache
log is 
........
java.lang.ClassCastException:
org.apache.activemq.broker.region.QueueSubscriptio
n cannot be cast to
org.apache.activemq.broker.region.DurableTopicSubscription
        at
org.apache.activemq.broker.jmx.DurableSubscriptionView.<init>(Durable
SubscriptionView.java:46)
        at
org.apache.activemq.broker.jmx.ManagedRegionBroker.registerSubscripti
on(ManagedRegionBroker.java:180)
        at
org.apache.activemq.broker.jmx.ManagedQueueRegion.createSubscription(
ManagedQueueRegion.java:45)
        at
org.apache.activemq.broker.region.AbstractRegion.addConsumer(Abstract
Region.java:253)
        at
org.apache.activemq.broker.region.RegionBroker.addConsumer(RegionBrok
er.java:372)
................................

I can get this work if i now change the client to listen to a topic rather
than a queue but my application needs transactionality and I can not use
topics . Any clues would be welcome

Cheers
Dheeru

Dejan Bosanac wrote:
> 
> Also, sending the some source code that demonstrate your problem would
> help
> as well
> 
> Cheers
> --
> Dejan Bosanac
> 
> Open Source Integration - http://fusesource.com/
> ActiveMQ in Action - http://www.manning.com/snyder/
> Blog - http://www.nighttale.net
> 
> 
> On Tue, Jul 14, 2009 at 5:43 PM, Jose Luna <j-luna@rocketmail.com> wrote:
> 
>>
>>
>>
>>
>> > I must confess I am a newbie to STOMP Php library and find it really
>> poor
>> in
>> > terms of documentation. Feels like someone developer on some planet has
>> done
>> > us all a favor by dumping some code on the google code list and given
>> us
>> a
>> > free hand on how to scratch our heads and try to get it all working
>> > together. The joys of open-source i guess.
>>
>> I'm not sure if you noticed, but the documentation from the project is
>> here: http://stomp.codehaus.org/PHP#PHP-Documentation
>> (As opposed to on the google code page.)
>>
>> I haven't used the STOMP PHP project, but the STOMP protocol itself is
>> well
>> documented.  If you can capture the packets being sent between the broker
>> and the client, it should be pretty easy to figure out what's going
>> wrong.
>>
>>
>>
>>
>>
> 
> 
> -----
> Dejan Bosanac
> 
> Open Source Integration - http://fusesource.com/
> ActiveMQ in Action - http://www.manning.com/snyder/
> Blog - http://www.nighttale.net
> 

-- 
View this message in context: http://www.nabble.com/Unable-to-have-multiple-consumers-on-the-same-broker-tp24467033p24517717.html
Sent from the ActiveMQ - User mailing list archive at Nabble.com.


Mime
View raw message