From users-return-53160-archive-asf-public=cust-asf.ponee.io@activemq.apache.org Fri Mar 26 12:26:25 2021 Return-Path: X-Original-To: archive-asf-public@cust-asf.ponee.io Delivered-To: archive-asf-public@cust-asf.ponee.io Received: from mxout1-ec2-va.apache.org (mxout1-ec2-va.apache.org [3.227.148.255]) by mx-eu-01.ponee.io (Postfix) with ESMTPS id 73B46180642 for ; Fri, 26 Mar 2021 13:26:25 +0100 (CET) Received: from mail.apache.org (mailroute1-lw-us.apache.org [207.244.88.153]) by mxout1-ec2-va.apache.org (ASF Mail Server at mxout1-ec2-va.apache.org) with SMTP id 6851444F81 for ; Fri, 26 Mar 2021 12:26:24 +0000 (UTC) Received: (qmail 26080 invoked by uid 500); 26 Mar 2021 12:26:23 -0000 Mailing-List: contact users-help@activemq.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: users@activemq.apache.org Delivered-To: mailing list users@activemq.apache.org Received: (qmail 26064 invoked by uid 99); 26 Mar 2021 12:26:23 -0000 Received: from spamproc1-he-de.apache.org (HELO spamproc1-he-de.apache.org) (116.203.196.100) by apache.org (qpsmtpd/0.29) with ESMTP; Fri, 26 Mar 2021 12:26:23 +0000 Received: from localhost (localhost [127.0.0.1]) by spamproc1-he-de.apache.org (ASF Mail Server at spamproc1-he-de.apache.org) with ESMTP id 09E8D1FF46E for ; Fri, 26 Mar 2021 12:26:22 +0000 (UTC) X-Virus-Scanned: Debian amavisd-new at spamproc1-he-de.apache.org X-Spam-Flag: NO X-Spam-Score: 0.001 X-Spam-Level: X-Spam-Status: No, score=0.001 tagged_above=-999 required=6.31 tests=[DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, HTML_MESSAGE=0.2, SPF_PASS=-0.001, URIBL_BLOCKED=0.001, WEIRD_PORT=0.001] autolearn=disabled Authentication-Results: spamproc1-he-de.apache.org (amavisd-new); dkim=pass (2048-bit key) header.d=gmail.com Received: from mx1-he-de.apache.org ([116.203.227.195]) by localhost (spamproc1-he-de.apache.org [116.203.196.100]) (amavisd-new, port 10024) with ESMTP id hRtcelyt4H1L for ; Fri, 26 Mar 2021 12:26:19 +0000 (UTC) Received-SPF: Pass (mailfrom) identity=mailfrom; client-ip=2607:f8b0:4864:20::b33; helo=mail-yb1-xb33.google.com; envelope-from=clebert.suconic@gmail.com; receiver= Received: from mail-yb1-xb33.google.com (mail-yb1-xb33.google.com [IPv6:2607:f8b0:4864:20::b33]) by mx1-he-de.apache.org (ASF Mail Server at mx1-he-de.apache.org) with ESMTPS id 522B87FCA4 for ; Fri, 26 Mar 2021 12:26:19 +0000 (UTC) Received: by mail-yb1-xb33.google.com with SMTP id v107so678145ybi.9 for ; Fri, 26 Mar 2021 05:26:19 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:references:in-reply-to:from:date:message-id:subject:to; bh=FsZHI/F8zpMYAtIUcEtljEAsvwLI+159hDT0pdRwEnI=; b=ckxok9GpiDutkf8Dx/nbKgC6T0mR+mPUnM3Roj0pMXXd9RkpLNqGN1wYB2Ba2c4o6S FCZdtVz4xt4zZkFY2zuJb+t60bMDyFGmP36tuEhZp+ZWQYeKmri2/etlgVdvsX39A1mn vX3hG8mvz+jXUQ1VqIa8mKI2mRyvbwM/Y5EyVHiCEX/Q2F62Ifk0nIxo5h+1Bp2cDqA5 ZS/mPkJsragd7ar7Zng19rFBFadCF+NE09Y5Kn6qZ/HMAd6iyzvpEv+uOR0iJLNQcw9e b5JAkb9zjyPqxxcdyTqANVkgyMyJzX0WiuUTzXMjRU6r+afKSjS2fMzpDX8AzHj2VBpR g5sw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to; bh=FsZHI/F8zpMYAtIUcEtljEAsvwLI+159hDT0pdRwEnI=; b=NIsQwSicSzrRh9xIN85FzHjeHpBUOJSlxaNSjs1DTt7jaKPS1iCoNdaiiacBrBxgrK y9jOdAkxyuvdoUk3S8ZKtWbso/BUm0Ibk0svOx7dBAZxrnrnh24eAVyQnUjMCNCk1KTg KMCY8HuohTSAkIBy80JpOvEwA9EoaaQzqik2xeI4a6s9ACuWUSgFmMqoaVe0RcawMaNi V8XODNNiduMzfprIu9NlK5FZ2zasTlFwisIVUmwtGqsd1LpyOvJDgOSUAP36LxgURBXI iZ3PmAm99RDp4g29eoxRVp3xWzHzw1djrgLRUa8bjdl27bhbVj5BOn7LKP6rSviX3DxZ 2vTw== X-Gm-Message-State: AOAM5336/gGTa4aeq8JU8hQE+vIRxWZKCwoqulPoXNFhXPzcUor1wOsM 9DJVszxJQR2ehcImSX33zq1KfeVDMugU17LpB+MWakCtiyM= X-Google-Smtp-Source: ABdhPJywVXp5s1savzsmjl89SrzWFVPqlibz4MqDdeQ4pFD907GMNFJLsSx5L/Z82TjrSjLggUhEBPOmG/xFTG+hxOw= X-Received: by 2002:a25:8c2:: with SMTP id 185mr19814181ybi.20.1616761576693; Fri, 26 Mar 2021 05:26:16 -0700 (PDT) MIME-Version: 1.0 References: In-Reply-To: From: Clebert Suconic Date: Fri, 26 Mar 2021 08:26:05 -0400 Message-ID: Subject: Re: send message To: users@activemq.apache.org Content-Type: multipart/alternative; boundary="0000000000007724b805be6fa380" --0000000000007724b805be6fa380 Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable On your case it would make sense if the streaming was not a file but a biffer. I get it. The optimization here wouldn=E2=80=99t be the copy but it would be not need= intg to duplicate the 500MB. We all thought you had a smaller buffer and did not want the copy. You can pass an InputStream as a property on the streaming. If you implemented an InputStream that will read from the NettyBuffer. The body would be read directly into smaller chunks into the Large Message Streaming. I=E2=80=99m not working today. As a matter of fact I=E2=80=99m using an iP= hone right now (pardon any typoes please) If you can=E2=80=99t figure it out let me know and I will write you an exam= ple Monday On Fri, Mar 26, 2021 at 3:35 AM wrote: > Not he application is a kind of custom mail server and the messages can > reach up to 500mb and are received via tcp and a netty smtp handler. > Therefore I have a netty direct buffer already and don't want bring the > huge messages back into the jvm. > > -----Urspr=C3=BCngliche Nachricht----- > Von: Clebert Suconic > Gesendet: Donnerstag, 25. M=C3=A4rz 2021 20:31 > An: users@activemq.apache.org > Betreff: Re: send message > > I assumed the data was already on a file. > > If you passed the file name. The receiver would receive a message where > you could either do the opposite. (Pass a file name to steam. Or just > receive steaming) > > At that size of message the optimization of the copy between your buffer > and a byte array makes little difference. > > On Thu, Mar 25, 2021 at 11:12 AM wrote: > > > So you mean I should save the ByteBuffer by myself to a file? > > > > --> and pass it over the property that would stream the file directly. > > (Available on core only) > > What do you mean? I understand that I shall pass the name of the file > > via a message property, right? > > How would the receiver side looks like? > > > > > > -----Urspr=C3=BCngliche Nachricht----- > > Von: Clebert Suconic > > Gesendet: Donnerstag, 25. M=C3=A4rz 2021 16:04 > > An: users@activemq.apache.org > > Betreff: Re: send message > > > > Sending a message this large will make it to be converted as a large > > stream and saved as a file on the server anyways... > > > > The copy between ByteBuffer and a byte array would become irrelevant > > at this point. > > > > If you want to send a large message this big, you could save it to a > > file, and pass it over the property that would stream the file directly= . > > (Available on core only) > > > > And don't convert a large message between protocols.. use a single > > protocol of your choice. > > > > On Thu, Mar 25, 2021 at 3:44 AM wrote: > > > > > > What are you talking about? > > > I want to send byte buffers with the size up to 500MB to a queue! > > > What do you mean with string and micro optimization! > > > The core api fails in my test already with sending/receiving a > > > simple > > string, yes, a simple test! > > > Does it make sense to have a 500mb native netty buffer received via > > > wire > > and tunnel it back through the jvm? > > > I don`t think so! > > > Does it make sense to tunnel megabytes of data through a stream or > > > even > > an byte array through the jvm? > > > Where ist the advantage of jms? > > > Why shall I not use the existing core api functions when the already > > support a netty buffer? > > > > > > -----Urspr=C3=BCngliche Nachricht----- > > > Von: Justin Bertram > > > Gesendet: Mittwoch, 24. M=C3=A4rz 2021 17:56 > > > An: users@activemq.apache.org > > > Betreff: Re: send message > > > > > > Well said, Tim. I was going to say the same thing about premature > > optimization. > > > > > > > > > Justin > > > > > > On Wed, Mar 24, 2021 at 7:04 AM Tim Bain > wrote: > > > > > > > One thing to keep in mind is that although the code may be > > > > slightly slower, if it lets you use an API that is more favorable > > > > (which might mean better documented, more portable, more stable > > > > across future versions, easier for others to maintain because > > > > they're already familiar with it, or a number of other potential > > > > advantages), > > that might be a win. > > > > > > > > Only you know your use case and whether the performance advantages > > > > of what you're trying to do actually outweigh the types of > > > > advantages I referenced in the first paragraph. But remember that > > > > premature optimization is the root of all evil, so make sure that > > > > your micro-optimization of avoiding the creation of a String is > > > > really a significant enough optimization in the context of your > > > > use case to justify the disadvantages of what you're trying to do. > > > > > > > > Tim > > > > > > > > On Tue, Mar 23, 2021, 9:20 AM Clebert Suconic > > > > > > > > wrote: > > > > > > > > > Not on the API itself. > > > > > > > > > > Try the core api example I sent you... and let me know what is > > > > > different from yours. > > > > > > > > > > On Tue, Mar 23, 2021 at 10:34 AM > wrote: > > > > > > > > > > > > I want to use the jms layer, but I've a netty application and > > > > > > I want to > > > > > write the ByteBuf mostly efficent to the queue. > > > > > > I think it makes no sense to convert it back from a native > > > > > > buffer into > > > > a > > > > > byte array or stream and tunnel this throught the jvm! > > > > > > > > > > > > Is there a way to use a ByteBuf with jms? > > > > > > > > > > > > -----Urspr=C3=BCngliche Nachricht----- > > > > > > Von: Clebert Suconic > > > > > > Gesendet: Dienstag, 23. M=C3=A4rz 2021 15:00 > > > > > > An: users@activemq.apache.org > > > > > > Betreff: Re: send message > > > > > > > > > > > > You were supposed to call reset right before sending though... > > > > > > but I > > > > did > > > > > not need it on my test.. I will post a link... > > > > > > > > > > > > Anyway, if you use the JMS API, the JMS layer is very thin, > > > > > > and I don't > > > > > think it would affect your performance in any way. you could > > > > > create a BytesMessage and all the detail would be hidden away > > > > > from the internal > > > > API. > > > > > > > > > > > > On Tue, Mar 23, 2021 at 9:57 AM Clebert Suconic < > > > > > clebert.suconic@gmail.com> wrote: > > > > > > > > > > > > > > I'm adding a test doing exactly what you did, and it's > working... > > > > > > > > > > > > > > give me 10 minutes and I will post a link here... > > > > > > > > > > > > > > On Tue, Mar 23, 2021 at 9:56 AM > > wrote: > > > > > > > > > > > > > > > > Same Issue! > > > > > > > > public void sendMessageToSmtpQueue(String text) > > > > > > > > throws > > > > > ActiveMQException { > > > > > > > > ClientSession session =3D > > > > > this.sessionFactory.createSession(); > > > > > > > > try { > > > > > > > > session.start(); > > > > > > > > ClientMessage message =3D > > > > > session.createMessage(true); > > > > > > > > > > message.setType(ClientMessage.TEXT_TYPE); > > > > > > > > > > message.getBodyBuffer().resetReaderIndex(); > > > > > > > > > > message.getBodyBuffer().writeString(text); > > > > > > > > ClientProducer producer =3D > > > > > session.createProducer(ACTIVE_MQ_SMTP_QUEUE); > > > > > > > > producer.send(message); > > > > > > > > } finally { > > > > > > > > session.close(); > > > > > > > > } > > > > > > > > } > > > > > > > > > > > > > > > > java.lang.IndexOutOfBoundsException: Error reading in > > > > > > > > simpleString, > > > > > length=3D1953068645 is greater than readableBytes=3D3 > > > > > > > > at > > > > > > > > > org.apache.activemq.artemis.api.core.SimpleString.readSimpleString > > > > (S > > > > im > > > > pleString.java:185) > > > > > > > > at > > > > > > > > > org.apache.activemq.artemis.api.core.SimpleString.readSimpleString > > > > (S > > > > im > > > > pleString.java:173) > > > > > > > > at > > > > > > > > > org.apache.activemq.artemis.core.buffers.impl.ChannelBufferWrapper > > > > .r > > > > ea > > > > dStringInternal(ChannelBufferWrapper.java:113) > > > > > > > > at > > > > > > > > > org.apache.activemq.artemis.core.buffers.impl.ChannelBufferWrapper > > > > .r > > > > ea > > > > dString(ChannelBufferWrapper.java:98) > > > > > > > > at com.tsystems.gematik.kim.mailserver.mq > > > > > > > > > .MailServerActiveMQClient.receiveTextMessageFromSmtpQueue(MailServ > > > > er > > > > Ac > > > > tiveMQClient.java:94) > > > > > > > > at com.tsystems.gematik.kim.mailserver.mq > > > > > > > > > .MailServerActiveMQClientTest.sendAndReceiveTextMessage(MailServer > > > > Ac > > > > ti > > > > veMQClientTest.java:37) > > > > > > > > at > > > > > java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0( > > > > > Na > > > > > ti > > > > > ve > > > > > Method) > > > > > > > > at > > > > > > > > > java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(Nat > > > > iv > > > > eM > > > > ethodAccessorImpl.java:62) > > > > > > > > at > > > > > > > > > java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke > > > > (D > > > > el > > > > egatingMethodAccessorImpl.java:43) > > > > > > > > at > > > > java.base/java.lang.reflect.Method.invoke(Method.java:566) > > > > > > > > at > > > > > > > > > org.junit.runners.model.FrameworkMethod$1.runReflectiveCall(Framew > > > > or > > > > kM > > > > ethod.java:50) > > > > > > > > at > > > > > > > > > org.junit.internal.runners.model.ReflectiveCallable.run(Reflective > > > > Ca > > > > ll > > > > able.java:12) > > > > > > > > at > > > > > > > > > org.junit.runners.model.FrameworkMethod.invokeExplosively(Framewor > > > > kM > > > > et > > > > hod.java:47) > > > > > > > > at > > > > > > > > > org.junit.internal.runners.statements.InvokeMethod.evaluate(Invoke > > > > Me > > > > th > > > > od.java:17) > > > > > > > > at > > > > > org.junit.runners.ParentRunner.runLeaf(ParentRunner.java:325) > > > > > > > > at > > > > > > > > > org.junit.runners.BlockJUnit4ClassRunner.runChild(BlockJUnit4Class > > > > Ru > > > > nn > > > > er.java:78) > > > > > > > > at > > > > > > > > > org.junit.runners.BlockJUnit4ClassRunner.runChild(BlockJUnit4Class > > > > Ru > > > > nn > > > > er.java:57) > > > > > > > > at > > > > > org.junit.runners.ParentRunner$3.run(ParentRunner.java:290) > > > > > > > > at > > > > > org.junit.runners.ParentRunner$1.schedule(ParentRunner.java:71) > > > > > > > > at > > > > > org.junit.runners.ParentRunner.runChildren(ParentRunner.java:288 > > > > > ) > > > > > > > > at > > > > > org.junit.runners.ParentRunner.access$000(ParentRunner.java:58) > > > > > > > > at > > > > > org.junit.runners.ParentRunner$2.evaluate(ParentRunner.java:268) > > > > > > > > at > > > > org.junit.runners.ParentRunner.run(ParentRunner.java:363) > > > > > > > > at > > > > > > > > > org.eclipse.jdt.internal.junit4.runner.JUnit4TestReference.run(JUn > > > > it > > > > 4T > > > > estReference.java:89) > > > > > > > > at > > > > > > > > > > org.eclipse.jdt.internal.junit.runner.TestExecution.run(TestExecution. > > > > java:41) > > > > > > > > at > > > > > > > > > org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(Re > > > > mo > > > > te > > > > TestRunner.java:541) > > > > > > > > at > > > > > > > > > org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(Re > > > > mo > > > > te > > > > TestRunner.java:763) > > > > > > > > at > > > > > > > > > org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.run(RemoteT > > > > es > > > > tR > > > > unner.java:463) > > > > > > > > at > > > > > > > > > > > > org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.main(Remote > > > > Te > > > > > > > > stRunner.java:209) > > > > > > > > > > > > > > > > > > > > > > > > -----Urspr=C3=BCngliche Nachricht----- > > > > > > > > Von: Clebert Suconic > > > > > > > > Gesendet: Dienstag, 23. M=C3=A4rz 2021 13:48 > > > > > > > > An: users@activemq.apache.org > > > > > > > > Betreff: Re: send message > > > > > > > > > > > > > > > > Can you try calling > > > > > > > > message.getBodyBuffer().resetReaderIndex(); > > > > > before the send? > > > > > > > > > > > > > > > > if that does not work I will try your code and see what > > happens. > > > > > > > > (Let me know if doesn't please) > > > > > > > > > > > > > > > > On Tue, Mar 23, 2021 at 7:55 AM Gary Tully > > > > > > > > > > > > > wrote: > > > > > > > > > > > > > > > > > > maybe take inspiration from > > > > > > > > > > > > > https://github.com/apache/activemq-artemis/blob/master/tests/integ > > > > > > > > > rati > > > > > > > > > > > > > on-tests/src/test/java/org/apache/activemq/artemis/tests/integrati > > > > > > > > > on/c lient/MessageBufferTest.java that passes a string, > > > > > > > > > but there are corresponding byte[] or buffer variants in > > > > > > > > > the api. If you want to skip the decoding, to access the > > > > > > > > > raw buffer, you need to parse the type to get to the > > appropriate part of the buffer. > > > > > > > > > There are loads of usage examples in the tests and they > > > > > > > > > all work, start there and break it as you go. > > > > > > > > > > > > > > > > > > the issue is the wire level encoding that the client > > > > > > > > > does, the > > > > JMS > > > > > > > > > api hides this, as do the typed accessors, but you can > > > > > > > > > get direct access to the encoded buffers via the core > > > > > > > > > api as you are doing but you need to be type aware, for > > > > > > > > > example a string can be utf-8 encoded or it can be raw > > > > > > > > > bytes on the wire, depending on the size and chars, the > > > > > > > > > encoding handles and hides this detail. But if you go > > > > > > > > > for direct > > access, you need to be aware of the encoding. > > > > > > > > > > > > > > > > > > > > > > > > > > > On Tue, 23 Mar 2021 at 07:37, > > > > > > > > > > > wrote: > > > > > > > > > > > > > > > > > > > > getDataBuffer gives same result! Already tried! > > > > > > > > > > > > > > > > > > > > -----Urspr=C3=BCngliche Nachricht----- > > > > > > > > > > Von: Clebert Suconic > > > > > > > > > > Gesendet: Dienstag, 23. M=C3=A4rz 2021 03:19 > > > > > > > > > > An: users@activemq.apache.org > > > > > > > > > > Betreff: Re: send message > > > > > > > > > > > > > > > > > > > > Why you don't use the JMS API for this? > > > > > > > > > > > > > > > > > > > > or if you really want to use the core API, use the > > > > > getReadOnlyBuffer() or getDataBuffer() on the Message instead. > > > > > > > > > > > > > > > > > > > > On Mon, Mar 22, 2021 at 12:01 PM Justin Bertram < > > > > > jbertram@apache.org> wrote: > > > > > > > > > > > > > > > > > > > > > > The stack-trace indicates you're invoking the > > "readString" > > > > > > > > > > > method on line > > > > > > > > > > > 93 of MailServerActiveMQClient.java, but I don't see > > > > > > > > > > > that > > > > call > > > > > > > > > > > in the code you pasted. Therefore, that stack-trace > > > > > > > > > > > doesn't seem correct. Can you clarify this? > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > Justin > > > > > > > > > > > > > > > > > > > > > > On Mon, Mar 22, 2021 at 10:55 AM Dondorp, Erwin > > > > > > > > > > > > > > > > > > > > > > wrote: > > > > > > > > > > > > > > > > > > > > > > > Fyi: > > > > > > > > > > > > 1953068645(decimal) =3D 74697665(hexadecimal) =3D > > > > > > > > > > > > "tive"(ascii > > > > > > > > > > > > text) And "tive" is likely part of the string > > "ActiveMQ"? > > > > > > > > > > > > e. > > > > > > > > > > > > > > > > > > > > > > > > -----Oorspronkelijk bericht----- > > > > > > > > > > > > Van: Tobias.Wolf@t-systems.com > > > > > > > > > > > > > > > > > > > > > > > > Verzonden: maandag 22 maart 2021 16:41 > > > > > > > > > > > > Aan: users@activemq.apache.org > > > > > > > > > > > > Onderwerp: AW: send message > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > EXTERNAL SENDER: Do not click any links or open a= ny > > > > > attachments unless > > > > > > > > > > > > you trust the sender and know the content is safe. > > > > > > > > > > > > EXP=C3=89DITEUR EXTERNE: Ne cliquez sur aucun li= en et > > > > n=E2=80=99ouvrez > > > > > aucune pi=C3=A8ce > > > > > > > > > > > > jointe =C3=A0 moins qu=E2=80=99ils ne proviennent d= =E2=80=99un > > > > > > > > > > > > exp=C3=A9diteur > > > > fiable, > > > > > > > > > > > > ou que vous ayez l'assurance que le contenu > > > > > > > > > > > > provient d'une > > > > > source s=C3=BBre. > > > > > > > > > > > > > > > > > > > > > > > > While sending / receiving a text message I get > > > > > > > > > > > > this > > > > > > > > > > > > > > > > > > > > > > > > java.lang.IndexOutOfBoundsException: Error reading > > > > > > > > > > > > in simpleString, > > > > > > > > > > > > length=3D1953068645 is greater than readableBytes= =3D3 > > > > > > > > > > > > at > > > > > > > > > > > > > > > > > > > > > org.apache.activemq.artemis.api.core.SimpleString.readSimpleString > > > > (S > > > > im > > > > pleString.java:185) > > > > > > > > > > > > at > > > > > > > > > > > > > > > > > > > > > org.apache.activemq.artemis.api.core.SimpleString.readSimpleString > > > > (S > > > > im > > > > pleString.java:173) > > > > > > > > > > > > at > > > > > > > > > > > > > > > > > > > > > org.apache.activemq.artemis.core.buffers.impl.ChannelBufferWrapper > > > > .r > > > > ea > > > > dStringInternal(ChannelBufferWrapper.java:113) > > > > > > > > > > > > at > > > > > > > > > > > > > > > > > > > > > org.apache.activemq.artemis.core.buffers.impl.ChannelBufferWrapper > > > > .r > > > > ea > > > > dString(ChannelBufferWrapper.java:98) > > > > > > > > > > > > at com.tsystems.gematik.kim.mailserver.mq > > > > > > > > > > > > > > > > > > > > > .MailServerActiveMQClient.receiveTextMessageFromSmtpQueue(MailServ > > > > er > > > > Ac > > > > tiveMQClient.java:93) > > > > > > > > > > > > at com.tsystems.gematik.kim.mailserver.mq > > > > > > > > > > > > > > > > > > > > > .MailServerActiveMQClientTest.sendAndReceive(MailServerActiveMQCli > > > > en > > > > tT > > > > est.java:28) > > > > > > > > > > > > at > > > > > > > > > > > > > > > > java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invo > > > > > > > > > > > > ke0( > > > > > > > > > > > > Nati > > > > > > > > > > > > ve > > > > > > > > > > > > Method) > > > > > > > > > > > > at > > > > > > > > > > > > > > > > > > > > > java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(Nat > > > > iv > > > > eM > > > > ethodAccessorImpl.java:62) > > > > > > > > > > > > at > > > > > > > > > > > > > > > > > > > > > java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke > > > > (D > > > > el > > > > egatingMethodAccessorImpl.java:43) > > > > > > > > > > > > at > > > > > java.base/java.lang.reflect.Method.invoke(Method.java:566) > > > > > > > > > > > > at > > > > > > > > > > > > > > > > > > > > > org.junit.runners.model.FrameworkMethod$1.runReflectiveCall(Framew > > > > or > > > > kM > > > > ethod.java:50) > > > > > > > > > > > > at > > > > > > > > > > > > > > > > > > > > > org.junit.internal.runners.model.ReflectiveCallable.run(Reflective > > > > Ca > > > > ll > > > > able.java:12) > > > > > > > > > > > > at > > > > > > > > > > > > > > > > > > > > > org.junit.runners.model.FrameworkMethod.invokeExplosively(Framewor > > > > kM > > > > et > > > > hod.java:47) > > > > > > > > > > > > at > > > > > > > > > > > > > > > > > > > > > org.junit.internal.runners.statements.InvokeMethod.evaluate(Invoke > > > > Me > > > > th > > > > od.java:17) > > > > > > > > > > > > at > > > > > org.junit.runners.ParentRunner.runLeaf(ParentRunner.java:325) > > > > > > > > > > > > at > > > > > > > > > > > > > > > > > > > > > org.junit.runners.BlockJUnit4ClassRunner.runChild(BlockJUnit4Class > > > > Ru > > > > nn > > > > er.java:78) > > > > > > > > > > > > at > > > > > > > > > > > > > > > > > > > > > org.junit.runners.BlockJUnit4ClassRunner.runChild(BlockJUnit4Class > > > > Ru > > > > nn > > > > er.java:57) > > > > > > > > > > > > at > > > > > org.junit.runners.ParentRunner$3.run(ParentRunner.java:290) > > > > > > > > > > > > at > > > > > org.junit.runners.ParentRunner$1.schedule(ParentRunner.java:71) > > > > > > > > > > > > at > > > > > > > > > > > > > > > > > org.junit.runners.ParentRunner.runChildren(ParentRunner.java:288 > > > > > ) > > > > > > > > > > > > at > > > > > org.junit.runners.ParentRunner.access$000(ParentRunner.java:58) > > > > > > > > > > > > at > > > > > org.junit.runners.ParentRunner$2.evaluate(ParentRunner.java:268) > > > > > > > > > > > > at > > > > > org.junit.runners.ParentRunner.run(ParentRunner.java:363) > > > > > > > > > > > > at > > > > > > > > > > > > > > > > > > > > > org.eclipse.jdt.internal.junit4.runner.JUnit4TestReference.run(JUn > > > > it > > > > 4T > > > > estReference.java:89) > > > > > > > > > > > > at > > > > > > > > > > > > > > > > > > > > > > org.eclipse.jdt.internal.junit.runner.TestExecution.run(TestExecution. > > > > java:41) > > > > > > > > > > > > at > > > > > > > > > > > > > > > > > > > > > org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(Re > > > > mo > > > > te > > > > TestRunner.java:541) > > > > > > > > > > > > at > > > > > > > > > > > > > > > > > > > > > org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(Re > > > > mo > > > > te > > > > TestRunner.java:763) > > > > > > > > > > > > at > > > > > > > > > > > > > > > > > > > > > org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.run(RemoteT > > > > es > > > > tR > > > > unner.java:463) > > > > > > > > > > > > at > > > > > > > > > > > > > > > > org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.main( > > > > > > > > > > > > Remo > > > > > > > > > > > > teTe > > > > > > > > > > > > stRunner.java:209) > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > -----Urspr=C3=BCngliche Nachricht----- > > > > > > > > > > > > Von: Justin Bertram > > > > > > > > > > > > Gesendet: Montag, 22. M=C3=A4rz 2021 16:34 > > > > > > > > > > > > An: users@activemq.apache.org > > > > > > > > > > > > Betreff: Re: send message > > > > > > > > > > > > > > > > > > > > > > > > What actually fails? Do you have a stack-trace? > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > Justin > > > > > > > > > > > > > > > > > > > > > > > > On Mon, Mar 22, 2021 at 9:53 AM > > > > > > > > > > > > > > > > > > > > > wrote: > > > > > > > > > > > > > > > > > > > > > > > > > I try to send and receive a netty ByteBuf > > > > > > > > > > > > > message, but it > > > > > fails. > > > > > > > > > > > > > What I'm doing wrong here? I even don't know ist > > > > > > > > > > > > > he mistake in sending or receiving! > > > > > > > > > > > > > I was thinking to use the jms layer, but I'm > > > > > > > > > > > > > receiving > > > > the > > > > > > > > > > > > > data buffer throught a netty buffer and I want > > > > > > > > > > > > > to avoid > > > > to > > > > > > > > > > > > > convert the buffer to a byte array! > > > > > > > > > > > > > > > > > > > > > > > > > > public void > > > > > > > > > > > > > sendMessageToSmtpQueue(ByteBuf > > > > > > > > > > > > > buf) throws ActiveMQException { > > > > > > > > > > > > > ClientSession session =3D > > > > > this.sessionFactory.createSession(); > > > > > > > > > > > > > try { > > > > > > > > > > > > > session.start(); > > > > > > > > > > > > > ClientMessage message =3D > > > > > session.createMessage(true); > > > > > > > > > > > > > > > > > > > > > > > > > > message.getBodyBuffer().writeBytes(buf, 0, > > > > > buf.readableBytes()); > > > > > > > > > > > > > ClientProducer producer =3D > > > > > > > > > > > > > session.createProducer(ACTIVE_MQ_SMTP_QUEUE); > > > > > > > > > > > > > producer.send(message); > > > > > > > > > > > > > } finally { > > > > > > > > > > > > > session.close(); > > > > > > > > > > > > > } > > > > > > > > > > > > > } > > > > > > > > > > > > > > > > > > > > > > > > > > public ActiveMQBuffer > > > > receiveMessageFromSmtpQueue() > > > > > > > > > > > > > throws ActiveMQException { > > > > > > > > > > > > > ActiveMQBuffer result; > > > > > > > > > > > > > ClientSession session =3D > > > > > this.sessionFactory.createSession(); > > > > > > > > > > > > > try { > > > > > > > > > > > > > session.start(); > > > > > > > > > > > > > ClientConsumer consumer =3D > > > > > > > > > > > > > session.createConsumer(ACTIVE_MQ_SMTP_QUEUE); > > > > > > > > > > > > > ClientMessage message =3D > > > > > consumer.receive(); > > > > > > > > > > > > > result =3D > > > > > > > > > > > > > ActiveMQBuffers.fixedBuffer(message.getBodyBuffe > > > > > > > > > > > > > rS > > > > > > > > > > > > > iz > > > > > > > > > > > > > e()); > > > > > > > > > > > > > > > > > > message.getBodyBuffer().readBytes(result); > > > > > > > > > > > > > } finally { > > > > > > > > > > > > > session.close(); > > > > > > > > > > > > > } > > > > > > > > > > > > > > > > > > > > > > > > > > return result; > > > > > > > > > > > > > } > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > public void startServer() throws Exception= { > > > > > > > > > > > > > this.configuration =3D new > > > > ConfigurationImpl(); > > > > > > > > > > > > > > > > > > > > > > > > > > this.configuration.addAcceptorConfiguration("in- > > > > > > > > > > > > > vm ", ACTIVE_MQ_EMBEDDED_SERVER_URL); > > > > > > > > > > > > > > > > > > this.configuration.setPersistenceEnabled(true); > > > > > > > > > > > > > > > > > this.configuration.setSecurityEnabled(false); > > > > > > > > > > > > > > > > > > > > > > > > > > this.configuration.addQueueConfiguration(new > > > > > > > > > > > > > QueueConfiguration(ACTIVE_MQ_SMTP_QUEUE)); > > > > > > > > > > > > > > > > > > > > > > > > > > this.server =3D new > > > > > ActiveMQServerImpl(this.configuration); > > > > > > > > > > > > > this.server.start(); > > > > > > > > > > > > > } > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > -- > > > > > > > > > > Clebert Suconic > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > -- > > > > > > > > Clebert Suconic > > > > > > > > > > > > > > > > > > > > > > > > > > > > -- > > > > > > > Clebert Suconic > > > > > > > > > > > > > > > > > > > > > > > > -- > > > > > > Clebert Suconic > > > > > > > > > > > > > > > > > > > > -- > > > > > Clebert Suconic > > > > > > > > > > > > > > > > > -- > > Clebert Suconic > > > -- > Clebert Suconic > --=20 Clebert Suconic --0000000000007724b805be6fa380--