In my server log I can see occasionally exceptions like:
Aug 11, 2015 10:13:34 AM org.apache.activemq.broker.TransportConnection serviceTransportException
WARNING: Transport Connection to: tcp://127.0.0.1:55472 failed: java.io.EOFException
Those do not seem to be actual events or messages send to the queue. They just happen randomly.
This is with ActiveMQ on Tomcat/Tomee
The code that configures ActiveMQ is:
My ActiveMQ configuration is very simple:
<?xml version="1.0" encoding="UTF-8"?>
<tomee>
<!-- see http://tomee.apache.org/containers-and-resources.html -->
<!-- activate next line to be able to deploy applications in apps -->
<!-- <Deployments dir="apps" /> -->
<Resource id="MyJmsResourceAdapter" type="ActiveMQResourceAdapter">
BrokerXmlConfig = broker:(tcp://localhost:61616)
ServerUrl = tcp://localhost:61616
</Resource>
<Resource id="MyJmsConnectionFactory" type="javax.jms.ConnectionFactory">
ResourceAdapter = MyJmsResourceAdapter
</Resource>
</tomee>
And to define the Queue I have a simple code:
@Resource(name = "myQueue")
private Queue barQueue;
@Resource
private ConnectionFactory connectionFactory;
/**
* Push Message to Queue
*
* @param payload
* @throws JMSException
*/
private void pushToQueue(Serializable payload) throws JMSException {
Connection connection = connectionFactory.createConnection();
connection.start();
// Create a Session
Session session = connection.createSession(false, Session.AUTO_ACKNOWLEDGE);
// Create a MessageProducer from the Session to the Topic or Queu
MessageProducer producer = session.createProducer(barQueue);
producer.setDeliveryMode(DeliveryMode.PERSISTENT);
// Create a message
ObjectMessage message = session.createObjectMessage(payload);
// Tell the producer to send the message
producer.send(message);
connection.close();
}
I can see messages fine in the log.
I just randomly see this EOFException popping up.
And it happens without me adding any messages to the queue.