Uploaded image for project: 'ActiveMQ Artemis'
  1. ActiveMQ Artemis
  2. ARTEMIS-214

exception when sending 10k message

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Closed
    • Major
    • Resolution: Fixed
    • None
    • 1.3.0
    • AMQP
    • None

    Description

      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();
      }

      Attachments

        Issue Links

          Activity

            People

              gaohoward Howard Gao
              andytaylor Andy Taylor
              Votes:
              2 Vote for this issue
              Watchers:
              7 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: