Thanks for the quick reply. See below:
On 08/29/2011 04:31 AM, Zane Bitter wrote:
[Adding this thread to the mailing list, as someone else may have a better answer, and it may be useful to other people writing agents in the future.]
On 26/08/11 23:42, Jeff Ortel wrote:
Zane,
I wrote a (test) agent named "package" which defines a class named "Package" with a method named: install(const char* name).
After launching the agent, I'm seeing the following:
[jortel@pulp package]$ qmf-tool localhost:49000 Management Tool for QMF qmf: list agents QMF Agents: Id Vendor Product Instance Epoch ==================================================================================
- 1 apache.org qpidd abd86426-651a-4cad-9fbc-bda2733b892c 2
2 matahariproject.org host c9161f88-293f-48af-90c2-c1f018ee8bf5 1 3 matahariproject.org package 08e69a0d-b69b-44e0-86d0-d85f743d92d2 1 qmf: set default 3 Default Agent: matahariproject.org:package:08e69a0d-b69b-44e0-86d0-d85f743d92d2 qmf: list classes Classes: qmf:
Can you think of any reason the package/class isn't showing up? How can I debug this? Are there log files I can look at? Suggestions?
Thanks,
Jeff
Good question. I would have guessed that it should show up as soon as you register the schema (i.e. the following code from the https://github.com/matahari/matahari/wiki/How-to-create-agent page):
int TestAgent::setup(qmf::AgentSession session) { _package.configure(session);
I followed the example this: https://github.com/matahari/matahari/wiki/How-to-create example with some modifications and somehow omitted:
_package.configure(session);
in TestAgent::setup().
Adding that fixed it!
(configure(session) calls session.registerSchema(), assuming you use the code that matahari autogenerates from the XML schema file.) Another possibility is that _package is not set up as an instance variable; I imagine that the schema gets de-registered if it goes out of scope and gets deleted.
As far as debugging goes, you can turn on the --trace option in the broker by adding it to the QPIDD_OPTIONS string in /etc/sysconfig/matahari-broker. You can increase the log level for the agents by adding the -v option to MATAHARI_AGENT_ARGS in /etc/sysconfig/matahari (this option can be added multiple times to increase the log level by several steps). Everything is logged to syslog.
This helps. Thanks.
cheers, Zane.