Hi Gordon,

> (I need to get a better grasp of the WCF model, any good links you can
> suggest?)

Any intro will do, but be warned that the bells and whistles above
messaging will get highlighted and seemingly simple terms like
"client", "binding", and "message" will have specific meaning within
WCF.

The easiest way to think of it is that there are two programming
models. The "channel model" is at the lower level and has variations
of send and receive that are analogous to session.messageTransfer()
and localQueue.get().  WcfPerftest.cs is an example and it should be
very easy to follow if you are at all familiar with the C++
perftest.cpp program.

The second programming model, the "service model", is built on top of
that and has fancy features for handling incoming messages and
imposing structure on message content to allow contracts between
clients and servers and discovery of available services.

But aside from providing the necessary glue between the service and
channel models, the Qpid WCF client is essentially all about the lower
level channel model and building an underlying "WCF transport channel"
over AMQP.

Another way to think of it is that WCF proxys and dispatchers sit
above a transport channel stack that is analogous to an SVRV.3 stream,
made up of channels/modules in a pipeline.  Closest to the wire is the
transport channel.  Further up the stack can be another channel that
maintains session state.  In this context, a WCF "binding" is the
description of the channel stack and its knob and dial settings.

People with a messaging background often find that the WCF "Message"
class has a couple of features that are unexpected: (a) its content
can be read or written at most once (corresponding to the time the
content is extracted or placed on the wire), (b) its content is
notionally an abstract XML infoset.  Regardless of whether you are
expecting the content to be elaborate SOAP or raw binary, you must go
through an XML based reader or writer to access the body.

> The samples both use "amqp:<exchange_name>?routingkey=<routing_key>"
> when sending and "amqp:<queue_name>" when receiving messages. How does
> the binding (in the AMQP sense) happen?

At the moment this has to be done outside WCF using external tools
like the python qpid-config command or a custom C++ program.  Near
term feature work will allow creating temporary queues on the fly for
subscribers to topic exchanges or associating a temporary response
queue with a WCF channel.  Further out, the plan is to supply
PowerShell commands to do more sophisticated management, which can in
turn be called from GUI management consoles or invoked from within
applications.

> How would I specify accept/acquire modes? 

There is no way at the moment, but the way to specify it would be as a
binding property (similar to setting the prefetch limit on incoming
messages).  .NET Framework 4.0, which will be out soon, has a new
feature called ReceiveContext which allows the application to specify
acceptance of a particular message.  Until then, a WCF message must be
processed in the scope of a transaction to defer its
acceptance/rejection (in this case at the time the transaction status
is determined).

> How would I get access to the message properties for sent and/or received 
> messages?

The extensibility point in the WCF Message class is the "Properties"
field which allows adding an arbitrary object (in our case an
AmqpProperty).

    AmqpProperties amqpProperties = new AmqpProperties();
    // sample AMQP property:
    amqpProperties.Durable = true;
    // arbitrary application property: Dictionary<String, AmqpType>
    amqpProperties.PropertyMap.Add("appkey1", new AmqpInt(1234));
    myWcfMessage.Properties.Add("AmqpProperties", amqpProperties);

I hope this helps.

Cliff

-----Original Message-----
From: Gordon Sim [mailto:g...@redhat.com] 
Sent: Monday, February 15, 2010 11:29 AM
To: dev@qpid.apache.org
Subject: Re: WCF/C++ client feature work for 0.7

On 02/10/2010 07:41 AM, Cliff Jansen (Interop Systems Inc) wrote:
> Hi Gordon,
>
>> I'd be keen to hear more of your thoughts an opinions on the new API
>> for the c++ client.
>
> I will try to take another look at it shortly.
>
>> It would be worth seeing if we can get better alignment between the
>> examples for all languages.
>
> Agreed.  I will do my best to make the upcoming interop examples
> resemble the main C++ and Java examples in structure as much as WCF
> allows.

I didn't mean to imply that was a task just for you! We should work 
together to make sure that the various components look more like part of 
a coherent suite.

(I need to get a better grasp of the WCF model, any good links you can 
suggest?)

>> Documentation of some form would be really great [...]
>
> Absolutely.  This is a known major outage and is just as high a priority
> for us as the functional feature work.
>
>> I notice for example you use uris that look similar to the JMS
>> "binding urls". Is the same syntax supported? There are some usability
>> issues with that format (in my opinion), especially when using more
>> complex patterns.
>
> I believe there are very few similarities.  The WCF model specifies
> the connection properties to servers (i.e. brokers) in a separate
> Binding which can be arbitrarily complex and already has established
> conventions for specifying many network related properties either
> programmatically or within XML config files.  The actual uris in the
> WCF client specify the minimum to identify a queue or exchange +
> routing key pair.

Could you describe that briefly? Does it assume that the queues and/or 
exchanges are set up using other tools or can you have them created as 
part of creating a producer or consumer?

The samples both use "amqp:<exchange_name>?routingkey=<routing_key>" 
when sending and "amqp:<queue_name>" when receiving messages. How does 
the binding (in the AMQP sense) happen?

How would I specify accept/acquire modes? How would I get access to the 
message properties for sent and/or received messages?

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



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

Reply via email to