You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@activemq.apache.org by Matthew Xie <an...@163.com> on 2006/08/07 08:07:48 UTC

Problem from open wire dotnet send float properties message to java

I found a problem while i using open wire dotnet api to send float property
message to java platform, the value i recieved that is deffrent with the
value setting in dotnet platform.

here is send value(dotnet) is:  float floatvalue = 2.1F
recieved value(java) is value is: 1.757237E-26

is this a bug or i make some mistake in my test?

follow is my test code:
dotnet:

            float value= 2.12F;
            Uri uri = new Uri("tcp://" + ip +
":61616?jms.useAsyncSend=true");
            factory = new ConnectionFactory(uri);
            using (IConnection connection = factory.CreateConnection())
            {
                ISession session =
connection.CreateSession(acknowledgementMode);

                IDestination destination = session.GetQueue(queueName);

                IMessageProducer producer =
session.CreateProducer(destination);
                producer.Persistent = true;

                // lets send a message
                String text = "text";
                ITextMessage request = session.CreateTextMessage(text);
                request.NMSPersistent = true;
                request.NMSCorrelationID = "abc";
   
                request.Properties["custom8"] = custom8;

                producer.Send(request);

            }

java:
public void onMessage(Message message) {
           System.out.println(message.getFloatProperty("custom8"));
}

could someone do me a favor?
Thx!

Matt
-- 
View this message in context: http://www.nabble.com/Problem-from-open-wire-dotnet-send-float-properties-message-to-java-tf2061832.html#a5679943
Sent from the ActiveMQ - User forum at Nabble.com.


Re: Problem from open wire dotnet send float properties message to java

Posted by Hiram Chirino <hi...@hiramchirino.com>.
Perhaps we need to run it through an endian conversion.  What platform
are you running on?

On 8/7/06, Matthew Xie <an...@163.com> wrote:
>
> I found a problem while i using open wire dotnet api to send float property
> message to java platform, the value i recieved that is deffrent with the
> value setting in dotnet platform.
>
> here is send value(dotnet) is:  float floatvalue = 2.1F
> recieved value(java) is value is: 1.757237E-26
>
> is this a bug or i make some mistake in my test?
>
> follow is my test code:
> dotnet:
>
>             float value= 2.12F;
>             Uri uri = new Uri("tcp://" + ip +
> ":61616?jms.useAsyncSend=true");
>             factory = new ConnectionFactory(uri);
>             using (IConnection connection = factory.CreateConnection())
>             {
>                 ISession session =
> connection.CreateSession(acknowledgementMode);
>
>                 IDestination destination = session.GetQueue(queueName);
>
>                 IMessageProducer producer =
> session.CreateProducer(destination);
>                 producer.Persistent = true;
>
>                 // lets send a message
>                 String text = "text";
>                 ITextMessage request = session.CreateTextMessage(text);
>                 request.NMSPersistent = true;
>                 request.NMSCorrelationID = "abc";
>
>                 request.Properties["custom8"] = custom8;
>
>                 producer.Send(request);
>
>             }
>
> java:
> public void onMessage(Message message) {
>            System.out.println(message.getFloatProperty("custom8"));
> }
>
> could someone do me a favor?
> Thx!
>
> Matt
> --
> View this message in context: http://www.nabble.com/Problem-from-open-wire-dotnet-send-float-properties-message-to-java-tf2061832.html#a5679943
> Sent from the ActiveMQ - User forum at Nabble.com.
>
>


-- 
Regards,
Hiram

Blog: http://hiramchirino.com

Re: Problem from open wire dotnet send float properties message to java

Posted by sparky2708 <da...@columbia.edu>.
Also am interested in this. Raised JIRA.
-- 
View this message in context: http://www.nabble.com/Problem-from-open-wire-dotnet-send-float-properties-message-to-java-tf2061832.html#a5687790
Sent from the ActiveMQ - User forum at Nabble.com.


Re: Problem from open wire dotnet send float properties message to java

Posted by James Strachan <ja...@gmail.com>.
It sounds like this could be a bug. Could you raise a JIRA for it please.

I wonder does anyone know how to write a Java-style float to a stream
in .Net? :)

On 8/7/06, Matthew Xie <an...@163.com> wrote:
>
> I found a problem while i using open wire dotnet api to send float property
> message to java platform, the value i recieved that is deffrent with the
> value setting in dotnet platform.
>
> here is send value(dotnet) is:  float floatvalue = 2.1F
> recieved value(java) is value is: 1.757237E-26
>
> is this a bug or i make some mistake in my test?
>
> follow is my test code:
> dotnet:
>
>             float value= 2.12F;
>             Uri uri = new Uri("tcp://" + ip +
> ":61616?jms.useAsyncSend=true");
>             factory = new ConnectionFactory(uri);
>             using (IConnection connection = factory.CreateConnection())
>             {
>                 ISession session =
> connection.CreateSession(acknowledgementMode);
>
>                 IDestination destination = session.GetQueue(queueName);
>
>                 IMessageProducer producer =
> session.CreateProducer(destination);
>                 producer.Persistent = true;
>
>                 // lets send a message
>                 String text = "text";
>                 ITextMessage request = session.CreateTextMessage(text);
>                 request.NMSPersistent = true;
>                 request.NMSCorrelationID = "abc";
>
>                 request.Properties["custom8"] = custom8;
>
>                 producer.Send(request);
>
>             }
>
> java:
> public void onMessage(Message message) {
>            System.out.println(message.getFloatProperty("custom8"));
> }
>
> could someone do me a favor?
> Thx!
>
> Matt
> --
> View this message in context: http://www.nabble.com/Problem-from-open-wire-dotnet-send-float-properties-message-to-java-tf2061832.html#a5679943
> Sent from the ActiveMQ - User forum at Nabble.com.
>
>


-- 

James
-------
http://radio.weblogs.com/0112098/