You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@qpid.apache.org by Gordon Sim <gs...@redhat.com> on 2011/02/11 14:10:25 UTC

QMFv2 Events in qpidd (was Re: Struggling to recv new (v2) events from a c++ client)

On 02/11/2011 04:18 AM, Ted Ross wrote:
> I've put an example C++ console that receives V2 events and prints them
> in subversion. It's at
> qpid/cpp/bindings/qmf2/examples/cpp/print_events.cpp. This should get
> you unblocked.

That example seems to have a continual busy loop in it somewhere (or am 
I running it incorrectly?). It would also perhaps be nice to print out 
the actual type of event.

I have a related question: by default the broker does not support QMFv2 
events it seems. There is a qpidd option to turn qmfv2 on which 
addresses that. However even without that option on other aspects of 
QMFv2 are supported (e.g. method invocation and querying). Is there a 
reason for having the v2 events disabled by default?




Re: QMFv2 Events in qpidd (was Re: Struggling to recv new (v2) events from a c++ client)

Posted by Angus Salkeld <as...@redhat.com>.
On Fri, Feb 11, 2011 at 02:44:17PM +0000, Gordon Sim wrote:
> On 02/11/2011 01:10 PM, Gordon Sim wrote:
> >I have a related question: by default the broker does not support QMFv2
> >events it seems. There is a qpidd option to turn qmfv2 on which
> >addresses that. However even without that option on other aspects of
> >QMFv2 are supported (e.g. method invocation and querying). Is there a
> >reason for having the v2 events disabled by default?
> 
> Enabling the qmfv2 option causes one test failure:
> cluster_tests.ShortTests.test_route_update, however that actually
> appears to be due to the fact that enabling qmfv2 disables qmfv1.
> With both enabled make check passes.

Thanks, after this commit I am getting the v2 events.

-Angus

> 
> Any objections to applying the attached patch to enable events for
> qmfv2? Only question I guess is what turning this option off
> actually means as it doesn't seem to prevent QMFv2 being used in
> general (just events as far as I have seen).

> Index: src/qpid/broker/Broker.h
> ===================================================================
> --- src/qpid/broker/Broker.h	(revision 1069734)
> +++ src/qpid/broker/Broker.h	(working copy)
> @@ -115,6 +115,7 @@
>          uint32_t maxSessionRate;
>          bool asyncQueueEvents;
>          bool qmf2Support;
> +        bool qmf1Support;
>  
>        private:
>          std::string getHome();
> Index: src/qpid/broker/Broker.cpp
> ===================================================================
> --- src/qpid/broker/Broker.cpp	(revision 1069734)
> +++ src/qpid/broker/Broker.cpp	(working copy)
> @@ -102,7 +102,8 @@
>      requireEncrypted(false),
>      maxSessionRate(0),
>      asyncQueueEvents(false),     // Must be false in a cluster.
> -    qmf2Support(false)
> +    qmf2Support(true),
> +    qmf1Support(true)
>  {
>      int c = sys::SystemInfo::concurrency();
>      workerThreads=c+1;
> @@ -122,7 +123,8 @@
>          ("max-connections", optValue(maxConnections, "N"), "Sets the maximum allowed connections")
>          ("connection-backlog", optValue(connectionBacklog, "N"), "Sets the connection backlog limit for the server socket")
>          ("mgmt-enable,m", optValue(enableMgmt,"yes|no"), "Enable Management")
> -        ("mgmt-qmf2", optValue(qmf2Support,"yes|no"), "Use QMF v2 for Broker Management")
> +        ("mgmt-qmf2", optValue(qmf2Support,"yes|no"), "Enable QMF v2 for Broker Management")
> +        ("mgmt-qmf1", optValue(qmf1Support,"yes|no"), "Enable QMF v1 for Broker Management")
>          ("mgmt-pub-interval", optValue(mgmtPubInterval, "SECONDS"), "Management Publish Interval")
>          ("queue-purge-interval", optValue(queueCleanInterval, "SECONDS"),
>           "Interval between attempts to purge any expired messages from queues")
> @@ -148,7 +150,7 @@
>  Broker::Broker(const Broker::Options& conf) :
>      poller(new Poller),
>      config(conf),
> -    managementAgent(conf.enableMgmt ? new ManagementAgent(!conf.qmf2Support,
> +    managementAgent(conf.enableMgmt ? new ManagementAgent(conf.qmf1Support,
>                                                            conf.qmf2Support)
>                                      : 0),
>      store(new NullMessageStore),
> Index: bindings/qmf2/examples/cpp/print_events.cpp
> ===================================================================
> --- bindings/qmf2/examples/cpp/print_events.cpp	(revision 1069734)
> +++ bindings/qmf2/examples/cpp/print_events.cpp	(working copy)
> @@ -55,7 +55,8 @@
>          if (session.nextEvent(event)) {
>              if (event.getType() == CONSOLE_EVENT) {
>                  const Data& data(event.getData(0));
> -                cout << "Event: timestamp=" << event.getTimestamp() << " severity=" <<
> +                cout << "Event: " << data.getSchemaId().getPackageName() << "." << data.getSchemaId().getName()
> +                     << " timestamp=" << event.getTimestamp() << " severity=" <<
>                      event.getSeverity() << " content=" << data.getProperties() << endl;
>              }
>          }
> 

> 
> ---------------------------------------------------------------------
> Apache Qpid - AMQP Messaging Implementation
> Project:      http://qpid.apache.org
> Use/Interact: mailto:dev-subscribe@qpid.apache.org


---------------------------------------------------------------------
Apache Qpid - AMQP Messaging Implementation
Project:      http://qpid.apache.org
Use/Interact: mailto:dev-subscribe@qpid.apache.org


Re: QMFv2 Events in qpidd (was Re: Struggling to recv new (v2) events from a c++ client)

Posted by Ken Giusti <kg...@redhat.com>.
Hi Gordon,

You're correct. The "enable v2" flag to the broker allows the broker to *send* V2-style unsolicited messages - heartbeats + events + data updates.   As you noted, even if the v2 flag is turned off, the broker will support queries/method calls from v2 (and v1) clients.

The current behaviour - sending just v1-style - was merely the "safe" option when we first implemented dual-version qmf support in the broker.

Enabling both by default should be safe - the only visible impact will be doubling the amount of generated unsolicited data. 

-K

----- Original Message -----
> On 02/11/2011 01:10 PM, Gordon Sim wrote:
> > I have a related question: by default the broker does not support
> > QMFv2
> > events it seems. There is a qpidd option to turn qmfv2 on which
> > addresses that. However even without that option on other aspects of
> > QMFv2 are supported (e.g. method invocation and querying). Is there
> > a
> > reason for having the v2 events disabled by default?
> 
> Enabling the qmfv2 option causes one test failure:
> cluster_tests.ShortTests.test_route_update, however that actually
> appears to be due to the fact that enabling qmfv2 disables qmfv1. With
> both enabled make check passes.
> 
> Any objections to applying the attached patch to enable events for
> qmfv2? Only question I guess is what turning this option off actually
> means as it doesn't seem to prevent QMFv2 being used in general (just
> events as far as I have seen).
> 
> 
> ---------------------------------------------------------------------
> Apache Qpid - AMQP Messaging Implementation
> Project: http://qpid.apache.org
> Use/Interact: mailto:dev-subscribe@qpid.apache.org

---------------------------------------------------------------------
Apache Qpid - AMQP Messaging Implementation
Project:      http://qpid.apache.org
Use/Interact: mailto:dev-subscribe@qpid.apache.org


Re: QMFv2 Events in qpidd (was Re: Struggling to recv new (v2) events from a c++ client)

Posted by Gordon Sim <gs...@redhat.com>.
On 02/11/2011 01:10 PM, Gordon Sim wrote:
> I have a related question: by default the broker does not support QMFv2
> events it seems. There is a qpidd option to turn qmfv2 on which
> addresses that. However even without that option on other aspects of
> QMFv2 are supported (e.g. method invocation and querying). Is there a
> reason for having the v2 events disabled by default?

Enabling the qmfv2 option causes one test failure: 
cluster_tests.ShortTests.test_route_update, however that actually 
appears to be due to the fact that enabling qmfv2 disables qmfv1. With 
both enabled make check passes.

Any objections to applying the attached patch to enable events for 
qmfv2? Only question I guess is what turning this option off actually 
means as it doesn't seem to prevent QMFv2 being used in general (just 
events as far as I have seen).