Re: Messenger API and subscriptions

2012-09-20 Thread William Henry


- Original Message -
 How about:
 
 int pn_messenger_subscribe(pn_messenger_t *messenger, const char
 *source,
 void* context);

This one I like.  It makes a lot of sense.

 void *pn_message_subscribe_context(pn_message_t *msg);
 

This one less so. I have to make an extra call after I receive the message. 
Then the implementation needs to do some sort of lookup.  I think it would be 
much more efficient if I had an API that returned the message and the context. 

William

 For C we can just leave it as NULL if we don't care about it and in
 the
 idiomatic APIs we can turn it into an optional argument.
 
 --Rafael
 
 On Wed, Sep 19, 2012 at 12:05 PM, William Henry whe...@redhat.com
 wrote:
 
 
 
  - Original Message -
  
  
   - Original Message -
Can we expose the subscription for an incoming message on the
messenger API in some way?
   
  
   Motivation:
  
   I'm trying to integrate with another messaging API.  That API may
   handle incoming messages differently based on their notion of a
   subscription.  Currently I would have to parse an incoming
   message's
   address and try to match that with some list of subscription
   strings.
  
   It would be handier if I could just get something back form the
   API
   to help me track/lookup.
  
 
  More thoughts:
 
  What would be nice is two API additions.
 
  int pn_messenger_context_subscribe(pn_messenger_t *messenger, const
  char
  *source, void* context);
  int pn_messenger_context_get(pn_messenger_t *messenger,
  pn_message_t *msg,
  void* context);
 
  The get would return the context for that message based on the
  subscription.
 
  Or something like that.
 
  Thoughts?
 
  William
 
   William
  
   
   
   
William
  
 
 


[jira] [Created] (PROTON-31) Message Corruption in point-to-point transfer via messenger

2012-09-20 Thread Ted Ross (JIRA)
Ted Ross created PROTON-31:
--

 Summary: Message Corruption in point-to-point transfer via 
messenger
 Key: PROTON-31
 URL: https://issues.apache.org/jira/browse/PROTON-31
 Project: Qpid Proton
  Issue Type: Bug
  Components: proton-c
Reporter: Ted Ross
 Attachments: send1.py

Using a modified version of the send.py messenger example (attached) and 
sending messages point-to-point from sender to receiver, messages become 
corrupted.

Output from the receiver:

{{
$ ./recv.py //~0.0.0.0/queue1
//0.0.0.0/queue1 (no subject) Message:0
//0.0.0.0/queue1 (no subject) Message:1
//0.0.0.0/queue1 (no subject) Message:2
//0.0.0.0/queue1 (no subject) Message:3
//0.0.0.0/queue1 (no subject) H(�]
//0.0.0.0/queue1 (no subject) Message:5
//0.0.0.0/queue1 (no subject) Message:6
//0.0.0.0/queue1 (no subject) Message:7
//0.0.0.0/queue1 (no subject) Message:8
//0.0.0.0/queue1 (no subject) Message:9
//0.0.0.0/queue1 (no subject) Message:10
//0.0.0.0/queue1 (no subject) Message:11
//0.0.0.0/queue1 (no subject) Message:12
//0.0.0.0/queue1 (no subject) Message:13
//0.0.0.0/queue1 (no subject) Message:14
//0.0.0.0/queue1 (no subject) Message:15
//0.0.0.0/queue1 (no subject) Message:16
//0.0.0.0/queue1 (no subject) Message:17
//0.0.0.0/queue1 (no subject) Message:18
//0.0.0.0/queue1 (no subject) Message:19
//0.0.0.0/queue1 (no subject) Message:20
//0.0.0.0/queue1 (no subject) Message:21
//0.0.0.0/queue1 (no subject) Message:22
//0.0.0.0/queue1 (no subject) Message:23
//0.0.0.0/queue1 (no subject) Message:24
//0.0.0.0/queue1 (no subject) Message:25
//0.0.0.0/queue1 (no subject) Message:26
//0.0.0.0/queue1 (no subject) Message:27
//0.0.0.0/queue1 (no subject) Message:28
//0.0.0.0/queue1 (no subject) Message:29
//0.0.0.0/queue1 (no subject) Message:30
//0.0.0.0/queue1 (no subject) Message:31
//0.0.0.0/queue1 (no subject) Message:32
//0.0.0.0/queue1 (no subject) Message:33
//0.0.0.0/queue1 (no subject) Message:34
[-4]: error decoding message: (null)
[-4]: error decoding message: (null)
[-4]: error decoding message: (null)
[-4]: error decoding message: (null)
}}




--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators
For more information on JIRA, see: http://www.atlassian.com/software/jira


[jira] [Updated] (PROTON-31) Message Corruption in point-to-point transfer via messenger

2012-09-20 Thread Ted Ross (JIRA)

 [ 
https://issues.apache.org/jira/browse/PROTON-31?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
 ]

Ted Ross updated PROTON-31:
---

Attachment: send1.py

Invoked as:

$ ./send1.py -a //0.0.0.0/queue1


 Message Corruption in point-to-point transfer via messenger
 ---

 Key: PROTON-31
 URL: https://issues.apache.org/jira/browse/PROTON-31
 Project: Qpid Proton
  Issue Type: Bug
  Components: proton-c
Reporter: Ted Ross
 Attachments: send1.py


 Using a modified version of the send.py messenger example (attached) and 
 sending messages point-to-point from sender to receiver, messages become 
 corrupted.
 Output from the receiver:
 {{
 $ ./recv.py //~0.0.0.0/queue1
 //0.0.0.0/queue1 (no subject) Message:0
 //0.0.0.0/queue1 (no subject) Message:1
 //0.0.0.0/queue1 (no subject) Message:2
 //0.0.0.0/queue1 (no subject) Message:3
 //0.0.0.0/queue1 (no subject) H(�]
 //0.0.0.0/queue1 (no subject) Message:5
 //0.0.0.0/queue1 (no subject) Message:6
 //0.0.0.0/queue1 (no subject) Message:7
 //0.0.0.0/queue1 (no subject) Message:8
 //0.0.0.0/queue1 (no subject) Message:9
 //0.0.0.0/queue1 (no subject) Message:10
 //0.0.0.0/queue1 (no subject) Message:11
 //0.0.0.0/queue1 (no subject) Message:12
 //0.0.0.0/queue1 (no subject) Message:13
 //0.0.0.0/queue1 (no subject) Message:14
 //0.0.0.0/queue1 (no subject) Message:15
 //0.0.0.0/queue1 (no subject) Message:16
 //0.0.0.0/queue1 (no subject) Message:17
 //0.0.0.0/queue1 (no subject) Message:18
 //0.0.0.0/queue1 (no subject) Message:19
 //0.0.0.0/queue1 (no subject) Message:20
 //0.0.0.0/queue1 (no subject) Message:21
 //0.0.0.0/queue1 (no subject) Message:22
 //0.0.0.0/queue1 (no subject) Message:23
 //0.0.0.0/queue1 (no subject) Message:24
 //0.0.0.0/queue1 (no subject) Message:25
 //0.0.0.0/queue1 (no subject) Message:26
 //0.0.0.0/queue1 (no subject) Message:27
 //0.0.0.0/queue1 (no subject) Message:28
 //0.0.0.0/queue1 (no subject) Message:29
 //0.0.0.0/queue1 (no subject) Message:30
 //0.0.0.0/queue1 (no subject) Message:31
 //0.0.0.0/queue1 (no subject) Message:32
 //0.0.0.0/queue1 (no subject) Message:33
 //0.0.0.0/queue1 (no subject) Message:34
 [-4]: error decoding message: (null)
 [-4]: error decoding message: (null)
 [-4]: error decoding message: (null)
 [-4]: error decoding message: (null)
 }}

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators
For more information on JIRA, see: http://www.atlassian.com/software/jira


Re: What is Messenger API

2012-09-20 Thread Darryl L. Pierce
On Thu, Sep 20, 2012 at 03:37:10PM -0400, Rajith Attapattu wrote:
 Given some of the recent discussions, it appears there isn't much
 consensus as to what the Messenger API is.
 For my own sanity, could someone with more knowledge on the $subject
 please explain the following?
 
 1. What is Messenger API ?
  i.e Do we have a doc or a wiki page that documents what the API
 is and more importantly what the expected behaviour is.

From my perspective, a Messenger is a high-level end-point for sending
and receiving messages. It keeps you from having to worry about the
underlying components of a session, a context, encoding and decoding
messages. Instead, it gives you very simple APIs to start and stop
communications, queue up and send messages and receive and then pull out
individual messages for processing.

 2. How is it different from the Messaging API aka Qpid API
 I'm looking for something more than the matrix given by Rafi, all
 though it provides a good start to understanding it.

Again, from my perspective, it reduces the complexity by, again, keeping
you from having to worry about the details of connecting with a remote
messaging endpoint.

Something else is that it's designed from the ground up with efficiency.
One specific one that comes to mind is the pn_messenger_get() API, which
can reuse existing instances of pn_message_t to avoid spending time
allocating memory. 

 3. How are we planning to position these various API's in the future?
 I agree that a lot of things are up in the air, but it's also good
 to share some early ideas all though they might change in the future.

My understanding is that we'll have a layer on top of Proton that will
provide the existing Qpid APIs while, underneath, Proton is doing the
heavy lifting.

I may be wrong on some (or all) points, in which case someone please set
me straight.

-- 
Darryl L. Pierce, Sr. Software Engineer @ Red Hat, Inc.
Delivering value year after year.
Red Hat ranks #1 in value among software vendors.
http://www.redhat.com/promo/vendor/



pgpgslEEOwyBa.pgp
Description: PGP signature


[jira] [Commented] (PROTON-31) Message Corruption in point-to-point transfer via messenger

2012-09-20 Thread William Henry (JIRA)

[ 
https://issues.apache.org/jira/browse/PROTON-31?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanelfocusedCommentId=13460036#comment-13460036
 ] 

William Henry commented on PROTON-31:
-

It doesn't go away for me in my modified version. 


$ ./recv_image.py //~0.0.0.0
Error mng.get:  [-4]: error decoding message: (null)
Error mng.get:  [-4]: error decoding message: (null)
Error mng.get:  [-4]: error decoding message: (null)


My send:
$ ./send_image.py -a //localhost
Block [ 1 ] put
Block [ 2 ] put
Block [ 3 ] put
Block [ 4 ] put
Block [ 5 ] put
Block [ 6 ] put
Block [ 7 ] put
Block [ 8 ] put
Block [ 9 ] put
ERROR amqp:connection:framing-error connection aborted
[0x1e34b30:0] ERROR[-2] connection aborted
Block [ 10 ] put
Traceback (most recent call last):
  File ./send_image.py, line 52, in module
if mng.put(msg):
  File /home/whenry/os/qpid-proton/trunk/proton-c/bindings/python/proton.py, 
line 58, in put
self._check(pn_messenger_put(self._mng, msg._msg))
  File /home/whenry/os/qpid-proton/trunk/proton-c/bindings/python/proton.py, 
line 32, in _check
raise exc([%s]: %s % (err, pn_messenger_error(self._mng)))
proton.MessengerException: [-2]: unable to send to address: //localhost 
(connect: Connection refused)

 Message Corruption in point-to-point transfer via messenger
 ---

 Key: PROTON-31
 URL: https://issues.apache.org/jira/browse/PROTON-31
 Project: Qpid Proton
  Issue Type: Bug
  Components: proton-c
Reporter: Ted Ross
 Attachments: send1.py


 Using a modified version of the send.py messenger example (attached) and 
 sending messages point-to-point from sender to receiver, messages become 
 corrupted.
 Output from the receiver:
 {{
 $ ./recv.py //~0.0.0.0/queue1
 //0.0.0.0/queue1 (no subject) Message:0
 //0.0.0.0/queue1 (no subject) Message:1
 //0.0.0.0/queue1 (no subject) Message:2
 //0.0.0.0/queue1 (no subject) Message:3
 //0.0.0.0/queue1 (no subject) H(�]
 //0.0.0.0/queue1 (no subject) Message:5
 //0.0.0.0/queue1 (no subject) Message:6
 //0.0.0.0/queue1 (no subject) Message:7
 //0.0.0.0/queue1 (no subject) Message:8
 //0.0.0.0/queue1 (no subject) Message:9
 //0.0.0.0/queue1 (no subject) Message:10
 //0.0.0.0/queue1 (no subject) Message:11
 //0.0.0.0/queue1 (no subject) Message:12
 //0.0.0.0/queue1 (no subject) Message:13
 //0.0.0.0/queue1 (no subject) Message:14
 //0.0.0.0/queue1 (no subject) Message:15
 //0.0.0.0/queue1 (no subject) Message:16
 //0.0.0.0/queue1 (no subject) Message:17
 //0.0.0.0/queue1 (no subject) Message:18
 //0.0.0.0/queue1 (no subject) Message:19
 //0.0.0.0/queue1 (no subject) Message:20
 //0.0.0.0/queue1 (no subject) Message:21
 //0.0.0.0/queue1 (no subject) Message:22
 //0.0.0.0/queue1 (no subject) Message:23
 //0.0.0.0/queue1 (no subject) Message:24
 //0.0.0.0/queue1 (no subject) Message:25
 //0.0.0.0/queue1 (no subject) Message:26
 //0.0.0.0/queue1 (no subject) Message:27
 //0.0.0.0/queue1 (no subject) Message:28
 //0.0.0.0/queue1 (no subject) Message:29
 //0.0.0.0/queue1 (no subject) Message:30
 //0.0.0.0/queue1 (no subject) Message:31
 //0.0.0.0/queue1 (no subject) Message:32
 //0.0.0.0/queue1 (no subject) Message:33
 //0.0.0.0/queue1 (no subject) Message:34
 [-4]: error decoding message: (null)
 [-4]: error decoding message: (null)
 [-4]: error decoding message: (null)
 [-4]: error decoding message: (null)
 }}

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators
For more information on JIRA, see: http://www.atlassian.com/software/jira