qpid-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From fadams <fraser.ad...@blueyonder.co.uk>
Subject QMF2 protocol query only seems to support OBJECT target
Date Sun, 10 Jul 2011 11:05:12 GMT
Hello,
I've been writing some code playing with QMF2 in JMS I've happily queried
with the OBJECT target

	public List<QMFConsoleData> getObjects(String className) {
		try {
			MapMessage request = requestResponseSession.createMapMessage();
			request.setJMSReplyTo(responseQueue);
			request.setStringProperty("x-amqp-0-10.app-id", "qmf2");
			request.setStringProperty("qmf.opcode", "_query_request");

			request.setString("_what", "OBJECT");
			request.setObject("_schema_id", new SchemaClassId(null, className, null,
null).mapEncode());

			requestProducer.send(request);
			Message response = responseConsumer.receive(10*1000);

			QueryResult result = new QueryResult(this,
buildMapListFromMessage(response));
			return result.getResults();
		} catch (QMFException e) {
			System.out.println("QMFException: " + e.getMessage());
			return new ArrayList<QMFConsoleData>();
		} catch (JMSException e) {
			return new ArrayList<QMFConsoleData>();
		}
	}

but when I play around with other values in "_what" the result ends up
sending an exception with text that implies unsupported target

I've tried 

QMF_QUERY_TARGET := 'SCHEMA_ID' |
                      'SCHEMA'    |
                      'OBJECT_ID' |
                      'OBJECT'

but everything other than OBJECT fails so it doesn't look like I can query
for schema information.

Is this correct or have I missed something? To be fair the contents of the
_values Map in the Map returned by the OBJECT query will give most of the
schema info, but it would be good to be able to get hold of the method names
for an object as well as the properties.

BTW in case it hasn't escaped your notice from the class names in the code
snippet above I've been getting a bit carried away and what started out as a
bit of a play seems to be turning into an implementation for a good chunk of
the QMF2 API for Java. Has anyone actually implemented this fully? I can't
see it in the download, only the (broken) QMF1 classes, so I'm thinking it's
a worthwhile exercise to write this. I've nearly got a Java port of
qpid-config working - pointless, but fun......


On a related note could anyone let me know how to query for Agents. My basic
Console class currently only talks to the broker Agent via
"qmf.default.direct/broker". I'm guessing querying for agents will be by
sending a message to a topic/subject - could someone suggest the structure
of the message and Address.

Cheers
Fraser









--
View this message in context: http://apache-qpid-users.2158936.n2.nabble.com/QMF2-protocol-query-only-seems-to-support-OBJECT-target-tp6567622p6567622.html
Sent from the Apache Qpid users mailing list archive at Nabble.com.

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


Mime
View raw message