Hi Sinduja,
I guess one of the first things to remember is what Ted said in a previous post:

"Agents are not able to communicate with each other, they can only be seen by qmf consoles. If you need to write an application that behaves as both an agent and a console, you can create an agent session and a console session using the same connection."

The following links reinforce this:

https://cwiki.apache.org/qpid/qpid-management-framework.html

https://cwiki.apache.org/qpid/qmfv2-project-page.html


QMF2 and QMF2 are similar in this respect. Actually I've never specifically tried this with my Java stuff, I really ought to write an example.

If you are using C++ If you look at the link in "bindings" that Ted pointed you at as well as an Agent example using the slightly weird C++ "not quite" QMF2 API (man that bugs me :-)) there are also examples of clients talking to an Agent, in those cases it's the Broker Management Agent but you *should* be able to combine that info with the Agent class to do what you need to.

One issue might be threading behaviour, I've not really looked into how that stuff is put together so there may be issues with thread safety (I'm not saying there is but it's worth keeping an eye out). I've not tried this with my Java stuff as I mentioned however I think that ought to be OK as I've explicitly used multiple Session objects internally. If in doubt you could use separate connections for the Agent/Console parts, but it's probably not necessary (just do some testing!!)


I'm not sure what you're doing with your application but with multiple Agents in the frame you'll probably want to spend some time on your Agent discovery/management logic to make sure you're sending the right messages to the right Agents.

If your "Console" requirements are simple it might be easier just to send messages "low level" using the QMF2 protocol rather than the API, but it's a judgement call. Gordon's code (and my Console Java class) should help you with this, there's not a world of difference between the Java and C++ code, you can definitely use the Java to point you in the right direction...



One other thing to be aware of, QMF is pretty much based on the direct exchange and most of the bindings made internally are quite simple and basic. For the vast majority of Use Cases this is not an issue but bear in mind that the queues are all default (default size, reject policy) and replyTo queues are all temporary exclusive queues.

If you need to do slightly unusual things such as allow *really* big (>105MB) payloads in QMF remote method invocations or have named replyTo destinations that survive console restarts (for example an Agent might take some very long time to generate a response) then you have to play a bit harder.

I added some enhancements to the API to allow me to specify "link" behaviour to the queues that get created, if you look at the BigPayloadAgentTest.java I set the Agent's reception queue to be 500MB with ring policy and using a non-default name via:

_agent.setConnection(connection, " ; {link: {name:'big-payload-agent', x-declare: {arguments: {'qpid.policy_type': ring, 'qpid.max_size': 500000000}}}}");

This allowed me to invoke a method with a 150MB payload :-)


It might be slightly unusual, but I'm looking at using QMF2 in a SOA like environment and my Services are actually processing components so I want to be able to do data transformations and send the results back using an asynchronous request/response model so being able to handle large payloads is pretty useful. Plus it amused me :-)

HTH, and good luck!!
Frase


On 25/02/12 19:06, [email protected] wrote:
Hi Fraser

I looked into those links and was quite useful. My requrement is to open
multiple agents and send and receive messages across within each other. Can
you tell me how to handle this situation. What are the im[ortant things
that we need to take cared of.

Regards,
Sinduja,R




On Sat, Feb 25, 2012 at 10:35 PM,<[email protected]>  wrote:

Thanks Fraser.....That was a clear history....I will surely nlook at ue
previous post...get in touch with you futther.....


On Fri, Feb 24, 2012 at 3:27 PM, Fraser Adams<
[email protected]>  wrote:

Hi Sinduja,
You didn't say which language you needed to write your agent in, I think
from your previous posts it most likely C++?

I think that the link that Ted gave you is probably the best one to get
you started with QMF in C++.

IMHO the layout in the source tree of QMF stuff is something of a mess
and really confusing, the "bindings" subdirectory isn't the most intuitive
place to find this stuff, I only came across it by accident!!! In addition
there's a fairly ad-hoc (to my eyes) mix of things floating around, for
example it's hard to tell with any real ease what relates to QMF1 and what
relates to QMF2!! And the Java QMF1 stuff is totally broken, but still in
the source tree as far as I'm aware (maybe it works with the Java broker,
but it doesn't with the C++ broker)

You should note that the QMF2 examples Ted pointed you at don't relate to
any obvious API, there's actually a QMF2 API specification that has been
published and this stuff unfortunately bears no relation to it, however it
does use the QMF2 protocol underneath.

If you happen to be using Java, well I've written an implementation of
the QMF2 API and you can find that here https://issues.apache.org/**
jira/browse/QPID-3675<https://issues.apache.org/jira/browse/QPID-3675>(I think 
I mentioned this in a previous reply to you)

Even if you're not using Java it's worth downloading and running ant,
I've put in loads of Javadoc and a lot of that cross-references QMF
documentation, which will help with your "share more details"

I've no idea when (or indeed if) this is likely to be taken up by the
qpid community, I do hope so but I've had very little feedback from anyone,
so it might just be me who has ever tried it :-)

For what it's worth there was a thread a month or so back on the subject
about moving QMF into its own sub-project, as you appear to have discovered
QMF is useful in its own right and QMF2 in particular is simply layered on
top.

I'd recommend that you read up on the QMF2 protocol (it's based on
passing Map Messages about) given the slight mess with respect to APIs if
your Agent isn't terribly complex you might get more mileage out of simply
using the protocol. I think that I posted some of Gordon Sim's C++ examples
in response to a previous posting of yours on the subject of adding and
deleting queues etc. actually I've looked back at my response and I posted
links to the protocol and API documentation too. I'm afraid with respect to
your comment "share some more details ...whatever " I've already shared
everything that exists which I'm aware of.

I'd say take a look at my java stuff, which is essentially a complete
implementation and has loads of examples, including Agents. Compare and
contrast that with the C++ Agent that Ted pointed you at. My Agent API
implementation isn't especially complex so it should be easy to pull out
the bits that you might need for a simple Agent (OK it's in Java but if you
look at Gordon's examples it's quite easy to port).

I just might take a look at porting my QMF2 stuff to C++, but before I
even think about that I'd want to be sure it was a worthwhile exercise,
doing the Java one was months of work over weekends....

I'm currently working on a REST API for QMF that uses my Java stuff as a
back-end, so I won't be looking at other projects until I've got some
traction on that as the REST stuff is more useful to me at the moment than
C++.


Please do read through the stuff I posted previously, unfortunately with
respect to QMF there are no "quick wins". I've even resorted to using
python and QMF1 myself for some tools despite my Java stuff because in "my
other life" e.g. at work I've got restrictions about package dependencies
(that's one reason I'm keen for the Java stuff to be adopted "officially")
and I know the python stuff will "just work".

It's not *really* that complicated, just a bit fiddly and disjoint. If
you feel like writing a C++ version of the API please do :-)

HTH
Frase


On 24/02/12 04:43, [email protected] wrote:

Thanks Ted...
Your reply was very useful....
I would be still more gratefule if you share some more details
...whatever
you know...please..



On Thu, Feb 23, 2012 at 7:49 PM, Ted Ross<[email protected]>   wrote:

  Sinduja,
There are a couple of example agents in the source tree
(qpid/cpp/bindings/qmf2/****examples) that you can reference.  You
first

create and open a normal messaging connection and then pass it to the
newly
created qmf agent.  Agents are not able to communicate with each other,
they can only be seen by qmf consoles.  If you need to write an
application
that behaves as both an agent and a console, you can create an agent
session and a console session using the same connection.

-Ted


On 02/23/2012 06:20 AM, [email protected] wrote:

Hi,
Can someone share some nice elaborated document or share some link
where I
can get good details about how to program in qmf-agent.
How to open connection in an qmf-agent, how to send messages between
diffrent agents. etc., I vrey badly need this info.
Please can someone share?

Regards,
Sinduja.R


------------------------------****----------------------------**--**---------

Apache Qpid - AMQP Messaging Implementation
Project:      http://qpid.apache.org
Use/Interact: mailto:users-subscribe@qpid.****apache.org<http://apache.org/>
<users-subscribe@**qpid.apache.org<[email protected]>>



------------------------------**------------------------------**---------
Apache Qpid - AMQP Messaging Implementation
Project:      http://qpid.apache.org
Use/Interact: 
mailto:users-subscribe@qpid.**apache.org<[email protected]>




---------------------------------------------------------------------
Apache Qpid - AMQP Messaging Implementation
Project:      http://qpid.apache.org
Use/Interact: mailto:[email protected]

Reply via email to