You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@activemq.apache.org by "Angus McAllister (JIRA)" <ji...@apache.org> on 2016/05/05 10:33:12 UTC

[jira] [Commented] (ARTEMIS-214) exception when sending 10k message

    [ https://issues.apache.org/jira/browse/ARTEMIS-214?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=15272169#comment-15272169 ] 

Angus McAllister commented on ARTEMIS-214:
------------------------------------------

Thanks for fixing this one guys; immensely appreciated.

> exception when sending 10k message
> ----------------------------------
>
>                 Key: ARTEMIS-214
>                 URL: https://issues.apache.org/jira/browse/ARTEMIS-214
>             Project: ActiveMQ Artemis
>          Issue Type: Bug
>          Components: AMQP
>            Reporter: Andy Taylor
>            Assignee: Howard Gao
>             Fix For: 1.3.0
>
>
> if you send a 10kb message using the qpid jms client the server throws an exception:
> java.lang.IllegalArgumentException
>         at java.nio.Buffer.limit(Buffer.java:267)
>         at org.apache.qpid.proton.codec.DecoderImpl.readRaw(DecoderImpl.java:945)
>         at org.apache.qpid.proton.codec.StringType$AllStringEncoding.readValue(StringType.java:169)
>         at org.apache.qpid.proton.codec.StringType$AllStringEncoding.readValue(StringType.java:121)
>         at org.apache.qpid.proton.codec.DynamicTypeConstructor.readValue(DynamicTypeConstructor.java:39)
>         at org.apache.qpid.proton.codec.DecoderImpl.readObject(DecoderImpl.java:885)
>         at org.apache.qpid.proton.message.impl.MessageImpl.decode(MessageImpl.java:647)
>         at org.apache.qpid.proton.message.impl.MessageImpl.decode(MessageImpl.java:577)
>         at org.apache.qpid.proton.jms.EncodedMessage.decode(EncodedMessage.java:46)
>         at org.apache.qpid.proton.jms.JMSMappingInboundTransformer.transform(JMSMappingInboundTransformer.java:40)
>         at org.apache.activemq.artemis.core.protocol.proton.converter.ProtonMessageConverter.inboundJMSType(ProtonMessageConverter.java:61)
>         at org.apache.activemq.artemis.core.protocol.proton.converter.ProtonMessageConverter.inbound(ProtonMessageConverter.java:47)
>         at org.apache.activemq.artemis.core.protocol.proton.plug.ProtonSessionIntegrationCallback.serverSend(ProtonSessionIntegrationCallback.java:269)
>         at org.proton.plug.context.server.ProtonServerReceiverContext.onMessage(ProtonServerReceiverContext.java:131)
>         at org.proton.plug.context.AbstractConnectionContext$LocalListener.onDelivery(AbstractConnectionContext.java:277)
>         at org.proton.plug.handler.Events.dispatch(Events.java:104)
>         at org.proton.plug.handler.impl.ProtonHandlerImpl.dispatch(ProtonHandlerImpl.java:399)
>         at org.proton.plug.handler.impl.ProtonHandlerImpl.flush(ProtonHandlerImpl.java:298)
>         at org.proton.plug.handler.impl.ProtonHandlerImpl.inputBuffer(ProtonHandlerImpl.java:178)
>         at org.proton.plug.context.AbstractConnectionContext.inputBuffer(AbstractConnectionContext.java:72)
>         at org.apache.activemq.artemis.core.protocol.proton.ActiveMQProtonRemotingConnection.bufferReceived(ActiveMQProtonRemotingConnection.java:142)
>         at org.apache.activemq.artemis.core.remoting.server.impl.RemotingServiceImpl$DelegatingBufferHandler.bufferReceived(RemotingServiceImpl.java:694)
>         at org.apache.activemq.artemis.core.remoting.impl.netty.ActiveMQChannelHandler.channelRead(ActiveMQChannelHandler.java:73)
>         at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:332)
>         at io.netty.channel.AbstractChannelHandlerContext.fireChannelRead(AbstractChannelHandlerContext.java:318)
>         at io.netty.channel.DefaultChannelPipeline.fireChannelRead(DefaultChannelPipeline.java:787)
>         at io.netty.channel.nio.AbstractNioByteChannel$NioByteUnsafe.read(AbstractNioByteChannel.java:125)
>         at io.netty.channel.nio.NioEventLoop.processSelectedKey(NioEventLoop.java:507)
>         at io.netty.channel.nio.NioEventLoop.processSelectedKeysOptimized(NioEventLoop.java:464)
>         at io.netty.channel.nio.NioEventLoop.processSelectedKeys(NioEventLoop.java:378)
>         at io.netty.channel.nio.NioEventLoop.run(NioEventLoop.java:350)
>         at io.netty.util.concurrent.SingleThreadEventExecutor$2.run(SingleThreadEventExecutor.java:116)
>         at java.lang.Thread.run(Thread.java:745)   
> the following code will show it
>  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();
>             }
>  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();
>     } 



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)