Return-Path: X-Original-To: apmail-activemq-issues-archive@minotaur.apache.org Delivered-To: apmail-activemq-issues-archive@minotaur.apache.org Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by minotaur.apache.org (Postfix) with SMTP id 751FD19092 for ; Tue, 26 Apr 2016 03:23:13 +0000 (UTC) Received: (qmail 19161 invoked by uid 500); 26 Apr 2016 03:23:13 -0000 Delivered-To: apmail-activemq-issues-archive@activemq.apache.org Received: (qmail 19116 invoked by uid 500); 26 Apr 2016 03:23:13 -0000 Mailing-List: contact issues-help@activemq.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: dev@activemq.apache.org Delivered-To: mailing list issues@activemq.apache.org Received: (qmail 19095 invoked by uid 99); 26 Apr 2016 03:23:13 -0000 Received: from arcas.apache.org (HELO arcas) (140.211.11.28) by apache.org (qpsmtpd/0.29) with ESMTP; Tue, 26 Apr 2016 03:23:13 +0000 Received: from arcas.apache.org (localhost [127.0.0.1]) by arcas (Postfix) with ESMTP id E54B72C1F60 for ; Tue, 26 Apr 2016 03:23:12 +0000 (UTC) Date: Tue, 26 Apr 2016 03:23:12 +0000 (UTC) From: "ASF GitHub Bot (JIRA)" To: issues@activemq.apache.org Message-ID: In-Reply-To: References: Subject: [jira] [Commented] (ARTEMIS-214) exception when sending 10k message MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit X-JIRA-FingerPrint: 30527f35849b9dde25b450d4833f0394 [ https://issues.apache.org/jira/browse/ARTEMIS-214?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=15257492#comment-15257492 ] ASF GitHub Bot commented on ARTEMIS-214: ---------------------------------------- Github user gaohoward commented on the pull request: https://github.com/apache/activemq-artemis/pull/482#issuecomment-214595574 I belive this is caused by the recent replacement of proton-jms with activemq-amqp lib. In activemq-amqp, it checks the message's destination like that: private static byte destinationType(Destination destination) { if(destination instanceof Queue) { return (byte)(destination instanceof TemporaryQueue?2:0); } else if(destination instanceof Topic) { return (byte)(destination instanceof TemporaryTopic?3:1); } else { throw new IllegalArgumentException("Unknown Destination Type passed to JMS Transformer."); } } Unfortunately the destination we have is ServerDestination which is only an instance of Destination. We probably need to subclasses that implements Queu and Topic jms interface respectively. > 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 > > 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)