Return-Path: X-Original-To: apmail-qpid-users-archive@www.apache.org Delivered-To: apmail-qpid-users-archive@www.apache.org Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by minotaur.apache.org (Postfix) with SMTP id D584311B3A for ; Mon, 21 Jul 2014 11:38:17 +0000 (UTC) Received: (qmail 5727 invoked by uid 500); 21 Jul 2014 11:38:17 -0000 Delivered-To: apmail-qpid-users-archive@qpid.apache.org Received: (qmail 5691 invoked by uid 500); 21 Jul 2014 11:38:17 -0000 Mailing-List: contact users-help@qpid.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: users@qpid.apache.org Delivered-To: mailing list users@qpid.apache.org Received: (qmail 5679 invoked by uid 99); 21 Jul 2014 11:38:16 -0000 Received: from athena.apache.org (HELO athena.apache.org) (140.211.11.136) by apache.org (qpsmtpd/0.29) with ESMTP; Mon, 21 Jul 2014 11:38:16 +0000 X-ASF-Spam-Status: No, hits=0.7 required=5.0 tests=RCVD_IN_DNSWL_NONE,SPF_NEUTRAL X-Spam-Check-By: apache.org Received-SPF: neutral (athena.apache.org: local policy) Received: from [81.169.146.216] (HELO mo4-p00-ob.smtp.rzone.de) (81.169.146.216) by apache.org (qpsmtpd/0.29) with ESMTP; Mon, 21 Jul 2014 11:38:11 +0000 DKIM-Signature: v=1; a=rsa-sha1; c=relaxed/relaxed; t=1405942669; l=2906; s=domk; d=comyno.com; h=Content-Transfer-Encoding:Content-Type:In-Reply-To:References: Subject:To:MIME-Version:Reply-To:From:Date; bh=A8OLcLrI8yhzN+lJK2oCZ/6z0c4=; b=V7EPgrCA9OfyhcINE4dBV0eE78uC/3Vl6y1wUEPSevEZAUQwpz2PubBWkqcRH8eaL5o +lnUBHQLuVsJyKrq5wwLFQrqh1ABGdSPXdgiyIFNI/sY9sFfsneXHERjLIz+oMQX+lchA BB/eM9o5BfbniD99aZkoMMf8o+QCVIBNyaw= X-RZG-AUTH: :LWIAZ0WpaLHEp3guTphWsEKFlupQz4kxs7vDzOIt0vdV+P7tSPaTyDmBHXd6VWdIIlvFkO4L6rT/0g== X-RZG-CLASS-ID: mo00 Received: from [192.168.102.34] (pD9FAC48C.dip0.t-ipconnect.de [217.250.196.140]) by smtp.strato.de (RZmta 35.2 DYNA|AUTH) with ESMTPSA id m01155q6LBbnc5o (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (Client did not present a certificate) for ; Mon, 21 Jul 2014 13:37:49 +0200 (CEST) Message-ID: <53CCFB8E.7010702@comyno.com> Date: Mon, 21 Jul 2014 13:37:50 +0200 From: Andreas Welchlin Reply-To: users@qpid.apache.org User-Agent: Mozilla/5.0 (Windows NT 6.1; WOW64; rv:24.0) Gecko/20100101 Thunderbird/24.6.0 MIME-Version: 1.0 To: users@qpid.apache.org Subject: Re: QPid 0.28 amqp1.0 - sending map from java to c++ does not work References: <53C92063.9080302@comyno.com> <53CCF77C.1010308@redhat.com> <53CCF94E.1050002@comyno.com> In-Reply-To: <53CCF94E.1050002@comyno.com> Content-Type: text/plain; charset=ISO-8859-15; format=flowed Content-Transfer-Encoding: 7bit X-Virus-Checked: Checked by ClamAV on apache.org Hi Gordon, Cool! I tried it and it works. Thank you very much! This workaround helps me very much. Cheers Andreas Am 21.07.2014 13:28, schrieb Andreas Welchlin: > Hi Gordon, > > thank you for your answer. I am also using the c++ broker (0.28). > > >How are you getting the content using qpid::messaging? Are you using > Message::getContentObject()? > > No, I am not using getContentObject but the decode function: > > > MyMessage::MyMessage(const qpid::messaging::Message &qpidMessage) > { > if (qpidMessage.getContentType() != "amqp/map") > { > // When Java Applications send an AMQP/MAP in amqp version > 1.0, then the string is found > // in the properties. > qpid::types::Variant::Map properties = > qpidMessage.getProperties(); > if (properties["x-opt-jms-type"].asString() != "amqp/map") > THROW(UsrException, "wrong content type (!= amqp/map): " > << qpidMessage.getContentType()); > } > > qpid::types::Variant::Map map; > qpid::messaging::decode(qpidMessage, map); > mSystemMessageId.assign(map["SytemMsgId"].asString()); > mContent = map["content"].asString(); > } > > Regards, > Andreas > > > Am 21.07.2014 13:20, schrieb Gordon Sim: >> On 07/18/2014 02:25 PM, Andreas Welchlin wrote: >>> Hi List, >>> >>> I used Hello.java from "qpid-java-amqp-1-0-client-jms-0.28.tar.gz" to >>> send an amqp 1.0 message which contains a map to an exchange. >>> >>> Java Code: >>> ------------------------------------------------------------------------------------------------------- >>> >>> >>> MapMessage mapmessage = producersession.createMapMessage(); >>> mapmessage.setStringProperty("hello","true"); >>> mapmessage.setBoolean("mybool", true); >>> mapmessage.setString("mystring", "hello"); >>> mapmessage.setLong("mylong", -25L); >>> messageProducer.send(mapmessage); >>> ------------------------------------------------------------------------------------------------------- >>> >>> >>> >>> This works when I read the message with the java application. >>> >>> But when I read it with a C++ client (linked qpid 0.28 library) then it >>> can read the message and dump it as a text but it fails decoding the >>> map. >>> The c++ client uses "{protocol:amqp1.0}" when the connection is >>> created. >>> The c++ client is able to decode map messages from other c++ senders >>> without any problems. >> >> It works for me when using the 0.28 version of both jms and c++ >> client libraries, and the c++ broker. >> >> How are you getting the content using qpid::messaging? Are you using >> Message::getContentObject()? >> >> --------------------------------------------------------------------- >> To unsubscribe, e-mail: users-unsubscribe@qpid.apache.org >> For additional commands, e-mail: users-help@qpid.apache.org >> > -- Comyno Ltd. Mainzer Landstrasse 46 60325 Frankfurt www.comyno.com --------------------------------------------------------------------- To unsubscribe, e-mail: users-unsubscribe@qpid.apache.org For additional commands, e-mail: users-help@qpid.apache.org