activemq-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Gary Tully <gary.tu...@gmail.com>
Subject Re: Where is ProducerInfo+ConsumerInfo data structure for Advisory Msgs?
Date Fri, 20 Aug 2010 10:14:51 GMT
The tests should always be the first port of call for example code you
can depend on:
for advisory support look at
http://svn.apache.org/viewvc/activemq/trunk/activemq-core/src/test/java/org/apache/activemq/advisory/AdvisoryTests.java?view=markup
and the other tests in that directory.

Typically you know what to expect in an advisory because you are
listening to a typed topic, so the destination  gives you the hint as
to what type to expect. ConsumerInfo on consumer advisories etc..
In addition, each command has a byte field with a unique type
accessible thorough
org.apache.activemq.command.DataStructure#getDataStructureType

On 20 August 2010 10:51, BenXS <bxstover@yahoo.co.uk> wrote:
>
> On page
>
> http://activemq.apache.org/advisory-message.html
>
> data structures named ProducerInfo + ConsumerInfo are mentioned.
> Where do I find these data structures explained (resp. which fields they
> contain in detail) ?
>
> Furthermore I wonder how I can detect wether an incoming msg on an Advisorc
> topic is a ProducerInfo OR ConsumerInfo type msg? On the web page above a
> java sample is shown where an incoming msg is always casted on ProducerInfo:
>
> ProducerInfo prod = (ProducerInfo) aMsg.getDataStructure();
>
> Why ProducerInfo and not ConsumerInfo?
>
> I expected some sort of investigation first:
>
> if (aMsg instanceOf ProducerInfo) {
>   ProducerInfo prod = (ProducerInfo) aMsg.getDataStructure(); }
> else  {
>   ConsumerInfo prod = (ConsumerInfo) aMsg.getDataStructure(); }
> ....
>
> So how should this look like officially? Is there a more elaborated java
> example?
>
> Ben
>
>
>
>
>
> --
> View this message in context: http://old.nabble.com/Where-is-ProducerInfo%2BConsumerInfo-data-structure-for-Advisory-Msgs--tp29490375p29490375.html
> Sent from the ActiveMQ - User mailing list archive at Nabble.com.
>
>



-- 
http://blog.garytully.com

Open Source Integration
http://fusesource.com

Mime
View raw message