You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@activemq.apache.org by Sodan <so...@sodan.dk> on 2008/10/05 20:41:45 UTC

( ActiveMQ CPP )

Hi there

I am using the c++ client, and the mesage I am getting back have different
members,
long, bytes etc.
The other end is trying to send me a message which contains a greek Zigma
sign, and he has encoded with UFT8 and done setbytes...
But when I do a read, not even on the bytes, but on the long I get:
OpenwireStringSupport::readString - Encoding not supported
        FILE:
..\src\main\activemq\connector\openwire\utils\OpenwireStringSupport.cpp,
LINE: 73

huh?

We want to be able to send back and forth UTF8 strings, and thought that
using bytes was the only way.
Any other good ideas ?

-- 
View this message in context: http://www.nabble.com/%28-ActiveMQ-CPP-%29-tp19827735p19827735.html
Sent from the ActiveMQ - User mailing list archive at Nabble.com.


Re: ( ActiveMQ CPP )

Posted by Sodan <so...@sodan.dk>.
The java sender was sending it as a stream, and so I could not
read it with readBytes. Now he send a bytearray, and our utf8 encoded
stuff comes around fine.

I would love to contribute, I just done have the time.



Sodan wrote:
> 
> ok, it might be that the java sender is actually sending a string,
> and not a bytearray. Will check this later today, and get back.
> 
> btw: is there utf8, unicode or wstring planned ?
> 
> Søren
> 
> 
> 
> Timothy Bish wrote:
>> 
>> On Mon, 2008-10-06 at 03:46 -0700, Sodan wrote:
>>> Btw, I cant even do map->getBytes ...
>>> 
>>> but why would it do exception in the first place, when reading the long
>>> ?
>> 
>> You would see this on the first read because the Message Properties are
>> unmarshalled lazily since many users don't even access them this way
>> message are delivered faster.  The first access is causing the
>> properties payload to be unmarshalled and the bytes you are setting are
>> apparently being interpreted as a string which sounds like a bug,
>> although without sample code its hard to say for sure.  
>> 
>> You could create a JIRA issue and attach a Java sample app and c++
>> sample that demonstrate what you are doing.  That way the problem will
>> be captured and someone can take a look at it as soon as possible.
>> 
>> Regards
>> Tim.
>> 
>> 
>> 
> 
> 

-- 
View this message in context: http://www.nabble.com/%27readString---Encoding-not-supported%27-exception-%28-ActiveMQ-CPP-%29-tp19827735p19854267.html
Sent from the ActiveMQ - User mailing list archive at Nabble.com.


Re: ( ActiveMQ CPP )

Posted by Timothy Bish <ta...@gmail.com>.

On Mon, 2008-10-06 at 05:59 -0700, Sodan wrote:
> ok, it might be that the java sender is actually sending a string,
> and not a bytearray. Will check this later today, and get back.
> 
> btw: is there utf8, unicode or wstring planned ?
> 
Currently there is nothing on the roadmap yet for this, however we are
always willing to accept contributions.  Most likely this wouldn't
appear until a 3.0 version of the client.

Regards
Tim.


Re: ( ActiveMQ CPP )

Posted by Sodan <so...@sodan.dk>.
ok, it might be that the java sender is actually sending a string,
and not a bytearray. Will check this later today, and get back.

btw: is there utf8, unicode or wstring planned ?

Søren



Timothy Bish wrote:
> 
> On Mon, 2008-10-06 at 03:46 -0700, Sodan wrote:
>> Btw, I cant even do map->getBytes ...
>> 
>> but why would it do exception in the first place, when reading the long ?
> 
> You would see this on the first read because the Message Properties are
> unmarshalled lazily since many users don't even access them this way
> message are delivered faster.  The first access is causing the
> properties payload to be unmarshalled and the bytes you are setting are
> apparently being interpreted as a string which sounds like a bug,
> although without sample code its hard to say for sure.  
> 
> You could create a JIRA issue and attach a Java sample app and c++
> sample that demonstrate what you are doing.  That way the problem will
> be captured and someone can take a look at it as soon as possible.
> 
> Regards
> Tim.
> 
> 
> 

-- 
View this message in context: http://www.nabble.com/%27readString---Encoding-not-supported%27-exception-%28-ActiveMQ-CPP-%29-tp19827735p19837451.html
Sent from the ActiveMQ - User mailing list archive at Nabble.com.


Re: ( ActiveMQ CPP )

Posted by Timothy Bish <ta...@gmail.com>.
On Mon, 2008-10-06 at 03:46 -0700, Sodan wrote:
> Btw, I cant even do map->getBytes ...
> 
> but why would it do exception in the first place, when reading the long ?

You would see this on the first read because the Message Properties are
unmarshalled lazily since many users don't even access them this way
message are delivered faster.  The first access is causing the
properties payload to be unmarshalled and the bytes you are setting are
apparently being interpreted as a string which sounds like a bug,
although without sample code its hard to say for sure.  

You could create a JIRA issue and attach a Java sample app and c++
sample that demonstrate what you are doing.  That way the problem will
be captured and someone can take a look at it as soon as possible.

Regards
Tim.


Re: ( ActiveMQ CPP )

Posted by Sodan <so...@sodan.dk>.
Btw, I cant even do map->getBytes ...

but why would it do exception in the first place, when reading the long ?
-- 
View this message in context: http://www.nabble.com/%27readString---Encoding-not-supported%27-exception-%28-ActiveMQ-CPP-%29-tp19827735p19835598.html
Sent from the ActiveMQ - User mailing list archive at Nabble.com.


Re: ( ActiveMQ CPP )

Posted by Sodan <so...@sodan.dk>.
Well. The 'other end' sends a long and and a string in a map message.

(from java sender)
 jmsmessage.setBytes("name", "somestring".getBytes("UTF8"));

If the string contains for example 'abc', then everything works fine,
I can read the long and the string.

But if the string contains for example a greek zigma sign encoded
to utf, and put into the map message as bytes, then as soon as I read the
long, then boom! ??

Søren



Timothy Bish wrote:
> 
> The C++ Client can only send and receive ASCII strings in Text Messages.
> To send Unicode strings your best bet is to encode them in a Bytes
> Message and decode them in your client code.  
> 
> To provide more insight it would be helpful if you could provide some
> sample code to show what exactly it is you are doing to encode and
> decode your data.
> 
> Regards
> Tim.
> 
> On Sun, 2008-10-05 at 11:41 -0700, Sodan wrote:
>> Hi there
>> 
>> I am using the c++ client, and the mesage I am getting back have
>> different
>> members,
>> long, bytes etc.
>> The other end is trying to send me a message which contains a greek Zigma
>> sign, and he has encoded with UFT8 and done setbytes...
>> But when I do a read, not even on the bytes, but on the long I get:
>> OpenwireStringSupport::readString - Encoding not supported
>>         FILE:
>> ..\src\main\activemq\connector\openwire\utils\OpenwireStringSupport.cpp,
>> LINE: 73
>> 
>> huh?
>> 
>> We want to be able to send back and forth UTF8 strings, and thought that
>> using bytes was the only way.
>> Any other good ideas ?
>> 
> 
> 
> 

-- 
View this message in context: http://www.nabble.com/%27readString---Encoding-not-supported%27-exception-%28-ActiveMQ-CPP-%29-tp19827735p19835564.html
Sent from the ActiveMQ - User mailing list archive at Nabble.com.


Re: ( ActiveMQ CPP )

Posted by Timothy Bish <ta...@gmail.com>.
The C++ Client can only send and receive ASCII strings in Text Messages.
To send Unicode strings your best bet is to encode them in a Bytes
Message and decode them in your client code.  

To provide more insight it would be helpful if you could provide some
sample code to show what exactly it is you are doing to encode and
decode your data.

Regards
Tim.

On Sun, 2008-10-05 at 11:41 -0700, Sodan wrote:
> Hi there
> 
> I am using the c++ client, and the mesage I am getting back have different
> members,
> long, bytes etc.
> The other end is trying to send me a message which contains a greek Zigma
> sign, and he has encoded with UFT8 and done setbytes...
> But when I do a read, not even on the bytes, but on the long I get:
> OpenwireStringSupport::readString - Encoding not supported
>         FILE:
> ..\src\main\activemq\connector\openwire\utils\OpenwireStringSupport.cpp,
> LINE: 73
> 
> huh?
> 
> We want to be able to send back and forth UTF8 strings, and thought that
> using bytes was the only way.
> Any other good ideas ?
> 


Re: UTF8 'Encoding not supported' error ( ActiveMQ CPP )

Posted by Sodan <so...@sodan.dk>.
onMessage(const Message *message)
{
	try
	{
		const MapMessage *mapMessage = dynamic_cast<const MapMessage *>(message);
		if (mapMessage != NULL)
		{
			long long sid = mapMessage->getLong("serialid");



actually gives an exception already here ! (reading the long)  ???

please advice...

--




Sodan wrote:
> 
> Hi there
> 
> I am using the c++ client, and the mesage I am getting back have different
> members,
> long, bytes etc.
> The other end is trying to send me a message which contains a greek Zigma
> sign, and he has encoded with UFT8 and done setbytes...
> But when I do a read, not even on the bytes, but on the long I get:
> OpenwireStringSupport::readString - Encoding not supported
>         FILE:
> ..\src\main\activemq\connector\openwire\utils\OpenwireStringSupport.cpp,
> LINE: 73
> 
> huh?
> 
> We want to be able to send back and forth UTF8 strings, and thought that
> using bytes was the only way.
> Any other good ideas ?
> 
> 

-- 
View this message in context: http://www.nabble.com/UTF8-%27Encoding-not-supported%27-error-%28-ActiveMQ-CPP-%29-tp19827735p19828648.html
Sent from the ActiveMQ - User mailing list archive at Nabble.com.