I'm trying to do a quick test with Spring, RabbitMQ and RabbitMQ JMS. I have configured my application with:
When I listen for a message in RabbitMQ, and publish it via the Management Interface, I get a StreamCorruptedException : invalid stream header: 61736466 thrown.
Digging through the code, I see this is thrown by the call in WhiteListObjectInputStream().super(). In the java.io.ObjectInputStream() constructor, it checks the stream header for the STREAM_MAGIC & STREAM_VERSION.
Is this because it was a non-Java library (ie: the management interface) that created the message? Is there a problem with the way I created the connection? Is there an issue with the amqp library?
@MichaelKlishin responded by indicating that "JMS client assumes it interoperates with either JMS client or (with certain restrictions) RabbitMQ Java client. Management UI publishing form sets an absolute minimum of message properties by default"
But would that be contrary to the idea? Shouldn't I be able to publish messages into RabbitMQ using whatever technology stack I want, and have my Java consumer/subscriber be able to receive the message? Does my producer/publisher HAVE to be Java based in order to use the JMS/Java client?
Thanks,
Eric
--You received this message because you are subscribed to a topic in the Google Groups "rabbitmq-users" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/rabbitmq-users/Zbcp9WL-vUM/unsubscribe.
To unsubscribe from this group and all its topics, send an email to rabbitmq-users+unsubscribe@googlegroups.com.
To post to this group, send email to rabbitm...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
--
You received this message because you are subscribed to the Google Groups "rabbitmq-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to rabbitmq-users+unsubscribe@googlegroups.com.
To post to this group, send email to rabbitmq-users@googlegroups.com.
@Componentpublic class Receiver {
@JmsListener(destination = "mailbox")
public void receiveMessage(Message msg) { log.info("Received <" + msg + ">"); }}
@Bean public DefaultJmsListenerContainerFactory jmsListenerContainerFactory() { DefaultJmsListenerContainerFactory factory = new DefaultJmsListenerContainerFactory(); factory.setConnectionFactory(connectionFactory()); factory.setDestinationResolver(new DynamicDestinationResolver()); return factory; }
@Bean public ConnectionFactory connectionFactory() { RMQConnectionFactory conn = new RMQConnectionFactory(); conn.setUsername("kodo"); conn.setPassword("kodo"); conn.setHost("localhost"); conn.setPort(5672); conn.setVirtualHost("/"); return conn; }
To unsubscribe from this group and all its topics, send an email to rabbitmq-user...@googlegroups.com.
To post to this group, send email to rabbitm...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
--
You received this message because you are subscribed to the Google Groups "rabbitmq-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to rabbitmq-user...@googlegroups.com.
Hi Eric,JMS standardizes an API, not a message format. It just so happens that AMQP 0-9-1 is used "behind the scenes" with additional, JMS-specific information, as you have found.See the "JMS and AMQP 0-9-1" section of this document: https://www.rabbitmq.com/jms-client.htmlIf you need AMQP 0-9-1 interoperability, use the RabbitMQ AMQP Java client.Thanks,Luke
On Monday, August 28, 2017 at 8:52:20 PM UTC-7, Eric B wrote:Thanks Luke,But I'm not sure I understand how that would be applicable; even if not defined by JMS, the message format would be defined by RabbitMQ (or AMQP). It should then be used by all RabbitMQ clients - both the Java client and whatever the Management Interface uses. In either case, I would expect that any client able to communicate with RabbitMQ would be compatible with any other client.Thanks,
EricOn Mon, Aug 28, 2017 at 10:54 PM, Luke Bakken <lba...@pivotal.io> wrote:Hi Eric,This may help explain what you're seeing: https://spring.io/understanding/AMQP"A limitation of JMS is that the APIs are specified, but the message format is not"Thanks,Luke
--
You received this message because you are subscribed to a topic in the Google Groups "rabbitmq-users" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/rabbitmq-users/Zbcp9WL-vUM/unsubscribe.
To unsubscribe from this group and all its topics, send an email to rabbitmq-users+unsubscribe@googlegroups.com.
To post to this group, send email to rabbitmq-users@googlegroups.com.
To unsubscribe from this group and stop receiving emails from it, send an email to rabbitmq-users+unsubscribe@googlegroups.com.
To post to this group, send email to rabbitmq-users@googlegroups.com.
To unsubscribe from this group and all its topics, send an email to rabbitmq-users+unsubscribe@googlegroups.com.
<Resource factory="com.rabbitmq.jms.admin.RMQObjectFactory"
host="localhost" name="jms/connectionFactory" password="guest"
port="5672" type="javax.jms.ConnectionFactory" username="guest"
virtualHost="/" />
<ResourceLink name="jms/connectionFactory"
global="jms/connectionFactory" type="javax.jms.ConnectionFactory" />
<jee:jndi-lookup id="jmsConnection"
jndi-name="jms/connectionFactory" />
<bean id="jmsDestinationResolver"
class="org.springframework.jms.support.destination.DynamicDestinationResolver" />
<bean id="debugLogger"
class="integration.AppJmsMessagingTemplate"
p:connectionFactory-ref="jmsConnection"
p:destinationResolver-ref="jmsDestinationResolver"
p:defaultDestinationName="logs.topic" p:pubSubDomain="true" />
<bean id="jmsLogListener"
class="integration.JmsLogListener" />
<bean id="jmsListenerContainer"
class="org.springframework.jms.listener.DefaultMessageListenerContainer"
p:connectionFactory-ref="jmsConnection"
p:destinationName="logs.topic"
p:destinationResolver-ref="jmsDestinationResolver"
p:messageListener-ref="jmsLogListener" p:pubSubDomain="true" />
To unsubscribe from this group and stop receiving emails from it, send an email to rabbitmq-user...@googlegroups.com.
To post to this group, send email to rabbitm...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
To unsubscribe from this group and all its topics, send an email to rabbitmq-user...@googlegroups.com.--
You received this message because you are subscribed to a topic in the Google Groups "rabbitmq-users" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/rabbitmq-users/Zbcp9WL-vUM/unsubscribe.
To post to this group, send email to rabbitm...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
python.exe rabbitmqadmin publish exchange=jms.durable.topic routing_key=logs.topic payload="hello, world" properties={\"headers\":{\"JMSType\":\"TextMessage\"}}