----- 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 > > > > > >