[rabbitmq-discuss] Rabbitmq message?
Jerry Kuch
jerryk at vmware.com
Thu Nov 3 19:55:53 GMT 2011
Hi:
Can you say a bit more about what precisely you were doing?
Also, have you consulted the tutorial series available here?
http://www.rabbitmq.com/tutorials/tutorial-one-java.html
There you'll see an AMQP basic.publish of a message. The basicPublish(...)
method on the Java client's Channel class is javadoc'ed here:
http://www.rabbitmq.com/releases/rabbitmq-java-client/v2.6.1/rabbitmq-java-client-javadoc-2.6.1/com/rabbitmq/client/Channel.html#basicPublish(java.lang.String, java.lang.String, com.rabbitmq.client.AMQP.BasicProperties, byte[])
AMQP message bodies are binary data. What you choose to use for this data
is up to you. When you say you tried to send a Java "class object" as a
"RabbitMQ message," what did you actually do? If you're planning to
serialize raw Java POJOs for sending you'll have to marshal them into
some format that the other end can deal with. In many ways, this isn't
a terribly good idea, and will limit the generality of your design perhaps
unnecessarily (for example, what if a consumer isn't written in Java? Or
doesn't have the right versions of whatever you were serializing on its
classpath? And that's even before you get into the security, safety and
correctness issues that come along with extralinguistic object creation
schemes).
It might be worth thinking a bit further about the meaning and intent of
what you're wanting to communicate between your producers and consumers
and choosing some format that both can deal with. Then we can help you
get down to brass tacks and the nitty gritty of actually transmitting it?
Best regards,
Jerry
----- Original Message -----
From: "Nguyen Mau Quoc Hoan" <nmqhoan at gmail.com>
To: rabbitmq-discuss at lists.rabbitmq.com
Sent: Thursday, November 3, 2011 10:49:41 AM
Subject: [rabbitmq-discuss] Rabbitmq message?
How many type of rabbitmq message?I tried to send and receive an Java class object as a Rabbitmq message but I failed? I read the rabbitmq example and I realized that all the messages has String type.
Could any one help me?
_______________________________________________
rabbitmq-discuss mailing list
rabbitmq-discuss at lists.rabbitmq.com
https://lists.rabbitmq.com/cgi-bin/mailman/listinfo/rabbitmq-discuss
More information about the rabbitmq-discuss
mailing list