qpid-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Ken Giusti <kgiu...@redhat.com>
Subject Re: Questions from a novice
Date Fri, 05 Apr 2013 18:27:51 GMT
Hi Frase

----- Original Message -----
> From: "Fraser Adams" <fraser.adams@blueyonder.co.uk>
> To: users@qpid.apache.org
> Sent: Friday, April 5, 2013 2:09:12 PM
> Subject: Re: Questions from a novice
> 
> Hi Guys,
> This thread has intrigued me a bit.
> 
> I must admit that I had thought the qmf.console.Console,
> qmf.console.Session stuff was QMF1 only so I was intrigued by the
> comments about QMF2. I dug out an old python program.
> 
> It starts like:
> 
> class AuditConsole(Console):
>      # AuditConsole Constructor
>      def __init__(self, whitelistFile):
>          self.whitelistFile = whitelistFile
>          self.whitelistLastModified = None
>          # Declare dictionary to map queue name to queue objects
>          self.queueNameMap = {}
>          # Declare dictionary to map queue name to subscription objects
> 
> ......
> 
> so it's subclassing Console and using the asynchronous approach. I
> initialise it with:
> 
>      console = AuditConsole(options.whitelist)
>      session = Session(console, rcvObjects=True, rcvEvents=True,
> userBindings=True, manageConnections=True)
> 
> 
>      session.bindClass("org.apache.qpid.broker", "queue")
>      session.bindClass("org.apache.qpid.broker", "exchange")
>      session.bindClass("org.apache.qpid.broker", "binding")
>      session.bindClass("org.apache.qpid.broker", "connection")
>      session.bindClass("org.apache.qpid.broker", "session")
>      session.bindClass("org.apache.qpid.broker", "subscription")
> 
>      brokers = []
>      try:
>          try:
>              for host in arguments:
>                  brokers.append(session.addBroker(host, None,
> options.sasl_mechanism))
> 
> 
> 
> I've got code
> 
> 
>      def objectStats(self, broker, record):
>          classKey = record.getClassKey()
>          oid = record.getObjectId()
> 
>          # Note that queue objects are keyed by both queue name and
> Object ID
>          if classKey.getClassName() == "queue":
>              print "queue: %s" % (oid.asMap())
> 
> 
>      def objectProps(self, broker, record):
>          classKey = record.getClassKey()
>          oid = record.getObjectId()
> 
>          # Note that queue objects are keyed by both queue name and
> Object ID
>          if classKey.getClassName() == "queue":
>              print "queue: %s %s" % (record.name, oid.asMap())
> 
> 
> but I only seem to be getting QMF1 push updates given the ObjectId
> 
> 
> queue: qmfc-v2-hb-zappa.4505.1 {'_object_name': '25', '_agent_name':
> '0', '_agent_epoch': 1662}
> queue: {'_object_name': '25', '_agent_name': '0', '_agent_epoch': 1662}
> queue: qmfc-v2-ui-zappa.4505.1 {'_object_name': '23', '_agent_name':
> '0', '_agent_epoch': 1662}
> queue: {'_object_name': '23', '_agent_name': '0', '_agent_epoch': 1662}
> queue: qmfc-v2-zappa.4505.1 {'_object_name': '21', '_agent_name': '0',
> '_agent_epoch': 1662}
> queue: {'_object_name': '21', '_agent_name': '0', '_agent_epoch': 1662}
> queue: reply-zappa.4505.1 {'_object_name': '14', '_agent_name': '0',
> '_agent_epoch': 1662}
> queue: {'_object_name': '14', '_agent_name': '0', '_agent_epoch': 1662}
> queue: topic-zappa.4505.1 {'_object_name': '18', '_agent_name': '0',
> '_agent_epoch': 1662}
> queue: {'_object_name': '18', '_agent_name': '0', '_agent_epoch': 1662}
> 
> queue: {'_object_name': '23', '_agent_name': '0', '_agent_epoch': 1662}
> queue: {'_object_name': '18', '_agent_name': '0', '_agent_epoch': 1662}
> 
> queue: {'_object_name': '23', '_agent_name': '0', '_agent_epoch': 1662}
> queue: {'_object_name': '18', '_agent_name': '0', '_agent_epoch': 1662}
> 
> 
> I'm running qpidd 0.23 with no options so both QMF1 and QMF2 data push
> should be available.
> 
> What's even odder is that clearly object name 23 relates to
> qmfc-v2-ui-zappa.4505.1 which is, given the name, one of the QMF2 queues.
> 
> I'm not at all sure why I should be seeing V1 ObjectIds
> 


Your code is fine, and your observations are 100% correct.   You _should_ be seeing both,
but are just getting V1 updates.  That's the bug from QPID-4689.  I _just_ pushed a fix to
trunk, so if you update, you should start seeing V2 objects.  The commit is here:

http://svn.apache.org/viewvc?view=revision&revision=1465050




> 
> I'm not particularly familiar with this API (nor really with python).
> The impression I've got from Bill's last post is that he's seeing both
> the QMF1 and QMF2 updates (that seems wrong anyway, I don't think being
> notified for each QMF version is what anyone would expect) but I only
> seem to be seeing QMF1 ObjectIds albeit relating to what appears to be
> QMF2 queues??????


Yes, getting both is awkward at best.  The root of the problem is that, by default, brokers
send two updates for each event - one in V1 format and one in V2.  The reason is to allow
for backward and forward compatibility among clients built for v1 and v2 serviced by the same
broker.

I think that we should do two things to address this:

1) start deprecating V1 in the broker by simply changing the default behavior to only send
updates as qmf V2.  V1 format updates can be turned on manually if needed.

2) fix the console by adding a configuration option to the Console to ignore V1 format object
updates.  The default would have to allow both, as some clients may actually want both if
some of their agents only speak v1.

I'd like to propose we do #1 after the next release (for 0.24).   What do you think?


> 
> Any thoughts??
> 
> Frase
> 
> 
> 
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@qpid.apache.org
> For additional commands, e-mail: users-help@qpid.apache.org
> 
> 

-- 
-K

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@qpid.apache.org
For additional commands, e-mail: users-help@qpid.apache.org


Mime
View raw message