You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@qpid.apache.org by sys8284 <sy...@hotmail.com> on 2013/01/26 17:16:38 UTC

Amqp message sender port

HI

How can i get the sender port  number i.e .., the port from which the AMQP
Message is sent from Source Computer

I know the destination port as 5672. But i need the origin port number



--
View this message in context: http://qpid.2158936.n2.nabble.com/Amqp-message-sender-port-tp7587517.html
Sent from the Apache Qpid users mailing list archive at Nabble.com.

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@qpid.apache.org
For additional commands, e-mail: users-help@qpid.apache.org


Re: Amqp message sender port

Posted by Gordon Sim <gs...@redhat.com>.
On 01/26/2013 04:16 PM, sys8284 wrote:
> HI
>
> How can i get the sender port  number i.e .., the port from which the AMQP
> Message is sent from Source Computer
>
> I know the destination port as 5672. But i need the origin port number

There is no way to get that. Messages delivered to subscribers do not 
contain the details of the publishing connection (other than, 
optionally, the userid).

Why do you need that information? Is it in order to send a response? Or 
to identify the senders for some logical purposes?

There may be a simpler way to do what you want. E.g. using reply-to, or 
some other message header/property (e.g. a subject).


---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@qpid.apache.org
For additional commands, e-mail: users-help@qpid.apache.org


Re: Amqp message sender port

Posted by Fraser Adams <fr...@blueyonder.co.uk>.
Hello,
what's the objective that you are trying to achieve?

Do you mean that you want a producer client to be able to work out the 
source port the connection is using, or given a producer client, a 
broker and a consumer client you want to figure out from the broker say 
what the source port is on inbound connections?

I don't thing either scenario is necessarily trivial.

In the first scenario if you are in Qpid Client code you normally use an 
API such as qpid::messaging in C++ or JMS in Java to provide an 
abstraction for creating a Connection, a Session etc.

In a Messaging system these abstractions tend to be pretty high level, 
so for example with JMS I'm pretty certain that there's not any way in 
the API to retrieve the underlying Socket or InetAddr. You *might* be 
able to get to the Socket by down-casting to the Qpid specific class 
that is implementing javax.jms.Connection and digging around there 
(similar for qpid::messaging) but it's not certain if this is even 
exposed on a public method on a private class.


If it's the second scenario then it's not trivial but it is exposed, the 
QMF connection ManagementObject exposes the host and port info for both 
sides in the address property (the old 0.8 broker only exposed one end 
but from 0.10 both sides are exposed).

The Qpid GUI that I recently posted info on exposes all of this and it's 
pretty easy to see most things one is likely to care about.

If you need to look at this in your own code you might want to take a 
look at a posting I sent in reply to Lance D. on the topic of 
"Instrumenting the Broker" (around the 11th of January). I posted him a 
couple of python programs I'd written (connection-logger and 
connection-audit) those illustrate how to get connection info (plus a 
load else) out of the broker via QMF. The might well help you get up and 
running.

HTH,
Frase



On 26/01/13 16:16, sys8284 wrote:
> HI
>
> How can i get the sender port  number i.e .., the port from which the AMQP
> Message is sent from Source Computer
>
> I know the destination port as 5672. But i need the origin port number
>
>
>
> --
> View this message in context: http://qpid.2158936.n2.nabble.com/Amqp-message-sender-port-tp7587517.html
> Sent from the Apache Qpid users mailing list archive at Nabble.com.
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@qpid.apache.org
> For additional commands, e-mail: users-help@qpid.apache.org
>


---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@qpid.apache.org
For additional commands, e-mail: users-help@qpid.apache.org