You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@qpid.apache.org by Bill Whiting <te...@bellsouth.net> on 2009/09/15 22:22:24 UTC

remote byte-order

Is there a way to get the byte order of the sending application from the 
message properties?
I've looked throught the API and don't see anything like that.

//Bill

---------------------------------------------------------------------
Apache Qpid - AMQP Messaging Implementation
Project:      http://qpid.apache.org
Use/Interact: mailto:users-subscribe@qpid.apache.org


Re: remote byte-order

Posted by John Dennis <jd...@redhat.com>.
On 09/17/2009 07:48 AM, Bill Whiting wrote:
> On 09/17/2009 03:47 AM, Gordon Sim wrote:
>> On 09/16/2009 07:34 PM, Bill Whiting wrote:
>>> I'm replacing other messaging with qpid. I have code for marshalling
>>> and demarshalling data that uses byte-order to know how to handle
>>> integers. I can add a custom property to the message that provides byte
>>> order, but it would be preferrable to have the byte-order of the sender
>>> implemented in the API.
>>
>> I'm not as convinced. It doesn't seem like the sort of information
>> that most applications will want automatically included in their
>> headers which means you would need some mechanism to enable it, and in
>> that case are you really gaining much?
>>
>> In the general case the content type would need to be set by the
>> application anyway, to let the receivers know the format. Appending
>> information on the byte-order to that seems like a reasonable approach
>> to me since it is relevant only to the decoding.
> Why not enable this for all applications? If an application doesn't need
> or want the information it won't hurt to have it along for the ride.

I'm not convinced either. You've essentially got a private protocol 
inside an AMQP content block. Most network protocols handle byte order 
on their own. They either write in network byte order or they include a 
byte order marker in the protocol. You can either add an application 
specific header as metadata to the AMQP message to convey the sender's 
byte order, or follow the conventional network protocol practices noted 
above (which would be of benefit if you ever use a transport other than 
AMQP). None of this requires a change to AMQP, which seems like a 
minority case, especially since it appears you're not following best 
practice in your private embedded protocol to begin with.

-- 
John Dennis <jd...@redhat.com>

Looking to carve out IT costs?
www.redhat.com/carveoutcosts/

---------------------------------------------------------------------
Apache Qpid - AMQP Messaging Implementation
Project:      http://qpid.apache.org
Use/Interact: mailto:users-subscribe@qpid.apache.org


Re: remote byte-order

Posted by Bill Whiting <te...@bellsouth.net>.
On 09/17/2009 03:47 AM, Gordon Sim wrote:
> On 09/16/2009 07:34 PM, Bill Whiting wrote:
>> I'm replacing other messaging with qpid.  I have code for marshalling
>> and demarshalling data that uses byte-order to know how to handle
>> integers. I can add a custom property to the message that provides byte
>> order, but it would be preferrable to have the byte-order of the sender
>> implemented in the API.
>
> I'm not as convinced. It doesn't seem like the sort of information 
> that most applications will want automatically included in their 
> headers which means you would need some mechanism to enable it, and in 
> that case are you really gaining much?
>
> In the general case the content type would need to be set by the 
> application anyway, to let the receivers know the format. Appending 
> information on the byte-order to that seems like a reasonable approach 
> to me since it is relevant only to the decoding.
Why not enable this for all applications?  If an application doesn't 
need or want the information it won't hurt to have it along for the ride.
>
>> //Bill
>>
>> On 09/16/2009 11:37 AM, John Dennis wrote:
>>> On 09/16/2009 11:25 AM, Bill Whiting wrote:
>>>> That is exactly the case, I'm thinking of parsing fixed record format
>>>> data. If the remote system is big-endian (or just different from me)
>>>> then I want to determine how to handle the data.
>>>
>>> Why not just write the content in network byte order?
>>>
>>
>>
>> ---------------------------------------------------------------------
>> Apache Qpid - AMQP Messaging Implementation
>> Project: http://qpid.apache.org
>> Use/Interact: mailto:users-subscribe@qpid.apache.org
>>
>
>
> ---------------------------------------------------------------------
> Apache Qpid - AMQP Messaging Implementation
> Project:      http://qpid.apache.org
> Use/Interact: mailto:users-subscribe@qpid.apache.org
>
>


---------------------------------------------------------------------
Apache Qpid - AMQP Messaging Implementation
Project:      http://qpid.apache.org
Use/Interact: mailto:users-subscribe@qpid.apache.org


Re: remote byte-order

Posted by Gordon Sim <gs...@redhat.com>.
On 09/16/2009 07:34 PM, Bill Whiting wrote:
> I'm replacing other messaging with qpid.  I have code for marshalling
> and demarshalling data that uses byte-order to know how to handle
> integers. I can add a custom property to the message that provides byte
> order, but it would be preferrable to have the byte-order of the sender
> implemented in the API.

I'm not as convinced. It doesn't seem like the sort of information that 
most applications will want automatically included in their headers 
which means you would need some mechanism to enable it, and in that case 
are you really gaining much?

In the general case the content type would need to be set by the 
application anyway, to let the receivers know the format. Appending 
information on the byte-order to that seems like a reasonable approach 
to me since it is relevant only to the decoding.

> //Bill
>
> On 09/16/2009 11:37 AM, John Dennis wrote:
>> On 09/16/2009 11:25 AM, Bill Whiting wrote:
>>> That is exactly the case, I'm thinking of parsing fixed record format
>>> data. If the remote system is big-endian (or just different from me)
>>> then I want to determine how to handle the data.
>>
>> Why not just write the content in network byte order?
>>
>
>
> ---------------------------------------------------------------------
> Apache Qpid - AMQP Messaging Implementation
> Project: http://qpid.apache.org
> Use/Interact: mailto:users-subscribe@qpid.apache.org
>


---------------------------------------------------------------------
Apache Qpid - AMQP Messaging Implementation
Project:      http://qpid.apache.org
Use/Interact: mailto:users-subscribe@qpid.apache.org


RE: remote byte-order

Posted by Steve Huston <sh...@riverace.com>.
Hi Bill,

> I'm replacing other messaging with qpid.  I have code for
marshalling 
> and demarshalling data that uses byte-order to know how to handle 
> integers.  I can add a custom property to the message that 
> provides byte 
> order, but it would be preferrable to have the byte-order of 
> the sender implemented in the API.

There's no byte order indicator in AMQP, so any extension to add this
would be private to Qpid. You could lobby the AMQP working group to
see if this could be in a future protocol version.

-Steve

> On 09/16/2009 11:37 AM, John Dennis wrote:
> > On 09/16/2009 11:25 AM, Bill Whiting wrote:
> >> That is exactly the case, I'm thinking of parsing fixed 
> record format
> >> data.  If the remote system is big-endian (or just 
> different from me)
> >> then I want to determine how to handle the data.
> >
> > Why not just write the content in network byte order?
> >
> 
> 
>
---------------------------------------------------------------------
> Apache Qpid - AMQP Messaging Implementation
> Project:      http://qpid.apache.org
> Use/Interact: mailto:users-subscribe@qpid.apache.org
> 
> 


---------------------------------------------------------------------
Apache Qpid - AMQP Messaging Implementation
Project:      http://qpid.apache.org
Use/Interact: mailto:users-subscribe@qpid.apache.org


Re: remote byte-order

Posted by Bill Whiting <te...@bellsouth.net>.
I'm replacing other messaging with qpid.  I have code for marshalling 
and demarshalling data that uses byte-order to know how to handle 
integers.  I can add a custom property to the message that provides byte 
order, but it would be preferrable to have the byte-order of the sender 
implemented in the API.

//Bill

On 09/16/2009 11:37 AM, John Dennis wrote:
> On 09/16/2009 11:25 AM, Bill Whiting wrote:
>> That is exactly the case, I'm thinking of parsing fixed record format
>> data.  If the remote system is big-endian (or just different from me)
>> then I want to determine how to handle the data.
>
> Why not just write the content in network byte order?
>


---------------------------------------------------------------------
Apache Qpid - AMQP Messaging Implementation
Project:      http://qpid.apache.org
Use/Interact: mailto:users-subscribe@qpid.apache.org


Re: remote byte-order

Posted by John Dennis <jd...@redhat.com>.
On 09/16/2009 11:25 AM, Bill Whiting wrote:
> That is exactly the case, I'm thinking of parsing fixed record format
> data.  If the remote system is big-endian (or just different from me)
> then I want to determine how to handle the data.

Why not just write the content in network byte order?

-- 
John Dennis <jd...@redhat.com>

Looking to carve out IT costs?
www.redhat.com/carveoutcosts/

---------------------------------------------------------------------
Apache Qpid - AMQP Messaging Implementation
Project:      http://qpid.apache.org
Use/Interact: mailto:users-subscribe@qpid.apache.org


Re: remote byte-order

Posted by Bill Whiting <te...@bellsouth.net>.
That is exactly the case, I'm thinking of parsing fixed record format 
data.  If the remote system is big-endian (or just different from me) 
then I want to determine how to handle the data.

//Bill

On 09/16/2009 11:03 AM, Gordon Sim wrote:
> On 09/16/2009 12:58 PM, Bill Whiting wrote:
>> Thanks, I'll add my own attribute for now. It would be beneficial to add
>> this to the API.
>
> It's only relevant if the content is encoded using some native byte 
> order dependent scheme, right? Or is there some other use case you 
> have in mind?
>
>> On 09/16/2009 03:21 AM, Gordon Sim wrote:
>>> On 09/15/2009 09:22 PM, Bill Whiting wrote:
>>>> Is there a way to get the byte order of the sending application 
>>>> from the
>>>> message properties?
>>>> I've looked throught the API and don't see anything like that.
>>>
>>> There isn't a standard header for that (nor do any of the Qpid clients
>>> automatically set it). However your applications can set a named
>>> property for that purpose, or perhaps indicate through the
>>> content-type how the data is encoded including a parameter describing
>>> the byte order if relevant?
>
> ---------------------------------------------------------------------
> Apache Qpid - AMQP Messaging Implementation
> Project:      http://qpid.apache.org
> Use/Interact: mailto:users-subscribe@qpid.apache.org
>
>


---------------------------------------------------------------------
Apache Qpid - AMQP Messaging Implementation
Project:      http://qpid.apache.org
Use/Interact: mailto:users-subscribe@qpid.apache.org


Re: remote byte-order

Posted by Gordon Sim <gs...@redhat.com>.
On 09/16/2009 12:58 PM, Bill Whiting wrote:
> Thanks, I'll add my own attribute for now. It would be beneficial to add
> this to the API.

It's only relevant if the content is encoded using some native byte 
order dependent scheme, right? Or is there some other use case you have 
in mind?

> On 09/16/2009 03:21 AM, Gordon Sim wrote:
>> On 09/15/2009 09:22 PM, Bill Whiting wrote:
>>> Is there a way to get the byte order of the sending application from the
>>> message properties?
>>> I've looked throught the API and don't see anything like that.
>>
>> There isn't a standard header for that (nor do any of the Qpid clients
>> automatically set it). However your applications can set a named
>> property for that purpose, or perhaps indicate through the
>> content-type how the data is encoded including a parameter describing
>> the byte order if relevant?

---------------------------------------------------------------------
Apache Qpid - AMQP Messaging Implementation
Project:      http://qpid.apache.org
Use/Interact: mailto:users-subscribe@qpid.apache.org


Re: remote byte-order

Posted by Jonathan Robie <jo...@redhat.com>.
Bill Whiting wrote:
> Thanks, I'll add my own attribute for now. It would be beneficial to 
> add this to the API.

+1

Jonathan

---------------------------------------------------------------------
Apache Qpid - AMQP Messaging Implementation
Project:      http://qpid.apache.org
Use/Interact: mailto:users-subscribe@qpid.apache.org


Re: remote byte-order

Posted by Bill Whiting <te...@bellsouth.net>.
Thanks, I'll add my own attribute for now. It would be beneficial to add 
this to the API.

//Bill

On 09/16/2009 03:21 AM, Gordon Sim wrote:
> On 09/15/2009 09:22 PM, Bill Whiting wrote:
>> Is there a way to get the byte order of the sending application from the
>> message properties?
>> I've looked throught the API and don't see anything like that.
>
> There isn't a standard header for that (nor do any of the Qpid clients 
> automatically set it). However your applications can set a named 
> property for that purpose, or perhaps indicate through the 
> content-type how the data is encoded including a parameter describing 
> the byte order if relevant?
>
> ---------------------------------------------------------------------
> Apache Qpid - AMQP Messaging Implementation
> Project:      http://qpid.apache.org
> Use/Interact: mailto:users-subscribe@qpid.apache.org
>
>


---------------------------------------------------------------------
Apache Qpid - AMQP Messaging Implementation
Project:      http://qpid.apache.org
Use/Interact: mailto:users-subscribe@qpid.apache.org


Re: remote byte-order

Posted by Gordon Sim <gs...@redhat.com>.
On 09/15/2009 09:22 PM, Bill Whiting wrote:
> Is there a way to get the byte order of the sending application from the
> message properties?
> I've looked throught the API and don't see anything like that.

There isn't a standard header for that (nor do any of the Qpid clients 
automatically set it). However your applications can set a named 
property for that purpose, or perhaps indicate through the content-type 
how the data is encoded including a parameter describing the byte order 
if relevant?

---------------------------------------------------------------------
Apache Qpid - AMQP Messaging Implementation
Project:      http://qpid.apache.org
Use/Interact: mailto:users-subscribe@qpid.apache.org