I am sending message using Apache qpid JMS client -
http://qpid.apache.org/components/jms/

            try
            {
               ctx = new InitialContext(properties);
               connection = ((ConnectionFactory)
ctx.lookup("connection")).createConnection();
               session = connection.createSession(false,
Session.CLIENT_ACKNOWLEDGE);
               producer = session.createProducer((Destination)
ctx.lookup("address"));
               if (!options.persistent)
               {
                    producer.setDeliveryMode(DeliveryMode.NON_PERSISTENT);   
               }
               else
               {
                    producer.setDeliveryMode(DeliveryMode.PERSISTENT);
               }
               connection.start();
               TextMessage message =
session.createTextMessage(options.messageText);
               producer.send(message);
               producer.close();
               session.close();
               connection.close();
            }
            catch (NamingException | JMSException e)
            {
                e.printStackTrace();
            }


properties:

java.naming.factory.initial=org.apache.qpid.jms.jndi.JmsInitialContextFactory
connectionfactory.connection=amqp://cbgc03:5672?amqp.idleTimeout=0&jms.username=admin&jms.password=admin&jms.forceAsyncSend=true
queue.address=test.queue

options.messageText is generated by:

    private static String createMessage(int messageSize)
    {
        final String AB = "0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZ";
        Random rnd = new Random();
        StringBuilder sb = new StringBuilder((int) messageSize);
        for (int j = 0; j < messageSize; j++ )
        {
            sb.append(AB.charAt(rnd.nextInt(AB.length())));
        }
        return sb.toString();
    }

I tried both persistent and non_persistent messages and sending both
messages ended with exception on the server. I also tried to remove
jms.forceAsyncSend and amqp.idleTimeout from connection string with same
result.

Vavricka



--
View this message in context: 
http://activemq.2283324.n4.nabble.com/Exception-when-sending-10-kB-message-tp4701387p4701391.html
Sent from the ActiveMQ - User mailing list archive at Nabble.com.

Reply via email to