WCF and MessageQueue

  • Thread starter Thread starter Peter Larsen [CPH]
  • Start date Start date
P

Peter Larsen [CPH]

Hi,

How do i send MSMQ messages using the old way
(System.Messaging.MessageQueue) to a host that use WCF ??
Messages sent through WCF are much bigger than messages created/sent through
MessageQueue.

Is there a way to exchange messages between the two systems ??

BR
Peter
 
Hi Peter,

As for WCF over MSMQ, the messages it transfers is still WCF format
messages(based on the Binding and configuration you use), MSMQ is used as
an transport layer here. Sure, the message size will become larger since it
contains WCF message envelope, and also has other additional overhead due
to the WCF processing pipeline(such as those message processing stacks at
server and client-side).

There does exists some information about optimizing the WCF over MSMQ:

#How can I speed up message processing when using MSMQ with WCF?
http://blogs.msdn.com/drnick/archive/2007/05/07/optimizing-msmq.aspx

However, I'm wondering whether WCF is actually necessary for your scenario?
If the data transfer doesn't quite rely on the WCF features(such as http
transfer, message security.... ), then you can consider still directly use
System.Messaging namespace classes to do the raw MSMQ programming. If
instead, you want the WCF service side keep using WCF, and the client-side
sending the raw MSMQ message, you can consider using the
MsmqIntegrationBinding. Here are some reference and examples:

#How to: Exchange Messages with WCF Endpoints and Message Queuing
Applications
http://msdn2.microsoft.com/en-us/library/ms789008.aspx

#SOA'izing MSMQ with WCF (and Why It's Worth It)
http://code.msdn.microsoft.com/msmqpluswcf

Anyway, when using WCF it does add some overheard due to the additional
services/features WCF processing pipeline and message envelope attach.

Sincerely,

Steven Cheng

Microsoft MSDN Online Support Lead


Delighting our customers is our #1 priority. We welcome your comments and
suggestions about how we can improve the support we provide to you. Please
feel free to let my manager know what you think of the level of service
provided. You can send feedback directly to my manager at:
(e-mail address removed).

==================================================
Get notification to my posts through email? Please refer to
http://msdn.microsoft.com/subscriptions/managednewsgroups/default.aspx#notif
ications.

==================================================
This posting is provided "AS IS" with no warranties, and confers no rights.




--------------------
 
Hi Steven,

Thanks for the links.

The point is that i already have a running WCF MSMQ (client/server) setup
and was trying to sent some messages from an older application - whitch did
not work at all. The host takes the message but goes into some kind of a
error state and must be restarted.

Anyway, i'll read the document you link to.

BR
Peter
 
Thanks for your reply Peter,

Yes, sending raw MSMQ message may cause problem if the WCF service side is
expecting a WCF friendly message format. the MsmqIntegrationBinding is the
one provided for interop between MSMQ and WCF side, you can try it though
it may still require some certain level of formatting of the raw MSMQ
message. If you have any new finding, welcome to post here.

Sincerely,

Steven Cheng

Microsoft MSDN Online Support Lead


Delighting our customers is our #1 priority. We welcome your comments and
suggestions about how we can improve the support we provide to you. Please
feel free to let my manager know what you think of the level of service
provided. You can send feedback directly to my manager at:
(e-mail address removed).

==================================================
Get notification to my posts through email? Please refer to
http://msdn.microsoft.com/subscriptions/managednewsgroups/default.aspx#notif
ications.

==================================================
This posting is provided "AS IS" with no warranties, and confers no rights.

--------------------
From: "Peter Larsen [CPH]" <[email protected]>
References: <#tL#[email protected]>
Subject: Re: WCF and MessageQueue
Date: Fri, 11 Apr 2008 10:46:29 +0200
 
Hi Peter,

Have you got progress on this issue? Welcome to post here if you have got
any new results or if there is anything else we can help.

Sincerely,

Steven Cheng

Microsoft MSDN Online Support Lead


Delighting our customers is our #1 priority. We welcome your comments and
suggestions about how we can improve the support we provide to you. Please
feel free to let my manager know what you think of the level of service
provided. You can send feedback directly to my manager at:
(e-mail address removed).

==================================================
Get notification to my posts through email? Please refer to
http://msdn.microsoft.com/subscriptions/managednewsgroups/default.aspx#notif
ications.

==================================================
This posting is provided "AS IS" with no warranties, and confers no rights.

--------------------
Content-Transfer-Encoding: 7bit
From: (e-mail address removed) (Steven Cheng [MSFT])
Organization: Microsoft
Date: Mon, 14 Apr 2008 02:24:55 GMT
Subject: Re: WCF and MessageQueue
Thanks for your reply Peter,

Yes, sending raw MSMQ message may cause problem if the WCF service side is
expecting a WCF friendly message format. the MsmqIntegrationBinding is the
one provided for interop between MSMQ and WCF side, you can try it though
it may still require some certain level of formatting of the raw MSMQ
message. If you have any new finding, welcome to post here.

Sincerely,

Steven Cheng

Microsoft MSDN Online Support Lead


Delighting our customers is our #1 priority. We welcome your comments and
suggestions about how we can improve the support we provide to you. Please
feel free to let my manager know what you think of the level of service
provided. You can send feedback directly to my manager at:
(e-mail address removed).

==================================================
Get notification to my posts through email? Please refer to
http://msdn.microsoft.com/subscriptions/managednewsgroups/default.aspx#noti f
ications.

==================================================
This posting is provided "AS IS" with no warranties, and confers no rights.

--------------------
From: "Peter Larsen [CPH]" <[email protected]>
References: <#tL#[email protected]>
<gwQ4z
 
Hi Steven,

Thank you for your reply.
I haven't tried it yet - but it is one of the first things in the pipeline.

BR
Peter
 
Hi Peter,

Glad to hear from you.

Sure. Welcome to post here if you get any new results.

Sincerely,

Steven Cheng

Microsoft MSDN Online Support Lead


Delighting our customers is our #1 priority. We welcome your comments and
suggestions about how we can improve the support we provide to you. Please
feel free to let my manager know what you think of the level of service
provided. You can send feedback directly to my manager at:
(e-mail address removed).

==================================================
Get notification to my posts through email? Please refer to
http://msdn.microsoft.com/subscriptions/managednewsgroups/default.aspx#notif
ications.

==================================================
This posting is provided "AS IS" with no warranties, and confers no rights.

--------------------
From: "Peter Larsen [CPH]" <[email protected]>
References: <#tL#[email protected]>
<[email protected]>
<#[email protected]>
Subject: Re: WCF and MessageQueue
Date: Wed, 16 Apr 2008 13:02:23 +0200
 
Hi Steven,

I can't get it to work.
Is it possible to create a WCF host that receives messages from both a WCF
client and a MSMQ client ??

The thing is that i have tried to create a host compatible with both the WCF
and the MSMQ method and it seems like the host isn't able to launch when
both is active. Is that true ??


BR
Peter


Steven Cheng said:
Hi Peter,

As for WCF over MSMQ, the messages it transfers is still WCF format
messages(based on the Binding and configuration you use), MSMQ is used as
an transport layer here. Sure, the message size will become larger since
it
contains WCF message envelope, and also has other additional overhead due
to the WCF processing pipeline(such as those message processing stacks at
server and client-side).

There does exists some information about optimizing the WCF over MSMQ:

#How can I speed up message processing when using MSMQ with WCF?
http://blogs.msdn.com/drnick/archive/2007/05/07/optimizing-msmq.aspx

However, I'm wondering whether WCF is actually necessary for your
scenario?
If the data transfer doesn't quite rely on the WCF features(such as http
transfer, message security.... ), then you can consider still directly use
System.Messaging namespace classes to do the raw MSMQ programming. If
instead, you want the WCF service side keep using WCF, and the client-side
sending the raw MSMQ message, you can consider using the
MsmqIntegrationBinding. Here are some reference and examples:

#How to: Exchange Messages with WCF Endpoints and Message Queuing
Applications
http://msdn2.microsoft.com/en-us/library/ms789008.aspx

#SOA'izing MSMQ with WCF (and Why It's Worth It)
http://code.msdn.microsoft.com/msmqpluswcf

Anyway, when using WCF it does add some overheard due to the additional
services/features WCF processing pipeline and message envelope attach.

Sincerely,

Steven Cheng

Microsoft MSDN Online Support Lead


Delighting our customers is our #1 priority. We welcome your comments and
suggestions about how we can improve the support we provide to you. Please
feel free to let my manager know what you think of the level of service
provided. You can send feedback directly to my manager at:
(e-mail address removed).

==================================================
Get notification to my posts through email? Please refer to
http://msdn.microsoft.com/subscriptions/managednewsgroups/default.aspx#notif
ications.

==================================================
This posting is provided "AS IS" with no warranties, and confers no
rights.




--------------------
From: "Peter Larsen [CPH]" <[email protected]>
Subject: WCF and MessageQueue
Date: Thu, 10 Apr 2008 11:04:59 +0200

Hi,

How do i send MSMQ messages using the old way
(System.Messaging.MessageQueue) to a host that use WCF ??
Messages sent through WCF are much bigger than messages created/sent through
MessageQueue.

Is there a way to exchange messages between the two systems ??

BR
Peter
 
Hi Peter,

So what's your current solution model? Are you creating two client
applications, one use System.Messaging api and one use WCF code and they
send message to the same message queue at server-side(which is monitoired
by a WCF service endpoint via MsmqIntegrationBinding)? is this what you're
doing now and what's the error behavior, you cannot receive message from
System.Messaging namespace?

Sincerely,

Steven Cheng

Microsoft MSDN Online Support Lead


Delighting our customers is our #1 priority. We welcome your comments and
suggestions about how we can improve the support we provide to you. Please
feel free to let my manager know what you think of the level of service
provided. You can send feedback directly to my manager at:
(e-mail address removed).

==================================================
Get notification to my posts through email? Please refer to
http://msdn.microsoft.com/subscriptions/managednewsgroups/default.aspx#notif
ications.

==================================================
This posting is provided "AS IS" with no warranties, and confers no rights.

--------------------
From: "Peter Larsen [CPH]" <[email protected]>
References: <#tL#[email protected]>
Subject: Re: WCF and MessageQueue
Date: Tue, 22 Apr 2008 13:03:19 +0200
Hi Steven,

I can't get it to work.
Is it possible to create a WCF host that receives messages from both a WCF
client and a MSMQ client ??

The thing is that i have tried to create a host compatible with both the WCF
and the MSMQ method and it seems like the host isn't able to launch when
both is active. Is that true ??


BR
Peter


Steven Cheng said:
Hi Peter,

As for WCF over MSMQ, the messages it transfers is still WCF format
messages(based on the Binding and configuration you use), MSMQ is used as
an transport layer here. Sure, the message size will become larger since
it
contains WCF message envelope, and also has other additional overhead due
to the WCF processing pipeline(such as those message processing stacks at
server and client-side).

There does exists some information about optimizing the WCF over MSMQ:

#How can I speed up message processing when using MSMQ with WCF?
http://blogs.msdn.com/drnick/archive/2007/05/07/optimizing-msmq.aspx

However, I'm wondering whether WCF is actually necessary for your
scenario?
If the data transfer doesn't quite rely on the WCF features(such as http
transfer, message security.... ), then you can consider still directly use
System.Messaging namespace classes to do the raw MSMQ programming. If
instead, you want the WCF service side keep using WCF, and the client-side
sending the raw MSMQ message, you can consider using the
MsmqIntegrationBinding. Here are some reference and examples:

#How to: Exchange Messages with WCF Endpoints and Message Queuing
Applications
http://msdn2.microsoft.com/en-us/library/ms789008.aspx

#SOA'izing MSMQ with WCF (and Why It's Worth It)
http://code.msdn.microsoft.com/msmqpluswcf

Anyway, when using WCF it does add some overheard due to the additional
services/features WCF processing pipeline and message envelope attach.

Sincerely,

Steven Cheng

Microsoft MSDN Online Support Lead


Delighting our customers is our #1 priority. We welcome your comments and
suggestions about how we can improve the support we provide to you. Please
feel free to let my manager know what you think of the level of service
provided. You can send feedback directly to my manager at:
(e-mail address removed).

==================================================
Get notification to my posts through email? Please refer to
http://msdn.microsoft.com/subscriptions/managednewsgroups/default.aspx#notif
ications.

==================================================
This posting is provided "AS IS" with no warranties, and confers no
rights.




--------------------
From: "Peter Larsen [CPH]" <[email protected]>
Subject: WCF and MessageQueue
Date: Thu, 10 Apr 2008 11:04:59 +0200

Hi,

How do i send MSMQ messages using the old way
(System.Messaging.MessageQueue) to a host that use WCF ??
Messages sent through WCF are much bigger than messages created/sent through
MessageQueue.

Is there a way to exchange messages between the two systems ??

BR
Peter
 
Hi Peter,

I've performed some further tests on my side. So far I have the following
application structure work correctly:

** A WCF service which use MsmqIntegrationBinding to listen on a private
transactioal queue

** a WCF client which send WCF message to the above service endpoint

** a MSMQ client(use System.Messaging) which send MSMQ message to the
target transactional queue directly

The service can receive messages from both clients. is this also what you
want to do? If necessary, I can send you my test solution.

Looking forward to your reply.

Sincerely,

Steven Cheng

Microsoft MSDN Online Support Lead


Delighting our customers is our #1 priority. We welcome your comments and
suggestions about how we can improve the support we provide to you. Please
feel free to let my manager know what you think of the level of service
provided. You can send feedback directly to my manager at:
(e-mail address removed).

==================================================
Get notification to my posts through email? Please refer to
http://msdn.microsoft.com/subscriptions/managednewsgroups/default.aspx#notif
ications.
==================================================
This posting is provided "AS IS" with no warranties, and confers no rights.

--------------------
Content-Type: text/plain
Content-Transfer-Encoding: 7bit
From: (e-mail address removed) (Steven Cheng [MSFT])
Organization: Microsoft
Date: Wed, 23 Apr 2008 09:47:54 GMT
Subject: Re: WCF and MessageQueue
Hi Peter,

So what's your current solution model? Are you creating two client
applications, one use System.Messaging api and one use WCF code and they
send message to the same message queue at server-side(which is monitoired
by a WCF service endpoint via MsmqIntegrationBinding)? is this what you're
doing now and what's the error behavior, you cannot receive message from
System.Messaging namespace?

Sincerely,

Steven Cheng

Microsoft MSDN Online Support Lead


Delighting our customers is our #1 priority. We welcome your comments and
suggestions about how we can improve the support we provide to you. Please
feel free to let my manager know what you think of the level of service
provided. You can send feedback directly to my manager at:
(e-mail address removed).

==================================================
Get notification to my posts through email? Please refer to
http://msdn.microsoft.com/subscriptions/managednewsgroups/default.aspx#noti f
ications.

==================================================
This posting is provided "AS IS" with no warranties, and confers no rights.

--------------------
From: "Peter Larsen [CPH]" <[email protected]>
References: <#tL#[email protected]>
Subject: Re: WCF and MessageQueue
Date: Tue, 22 Apr 2008 13:03:19 +0200
Hi Steven,

I can't get it to work.
Is it possible to create a WCF host that receives messages from both a WCF
client and a MSMQ client ??

The thing is that i have tried to create a host compatible with both the WCF
and the MSMQ method and it seems like the host isn't able to launch when
both is active. Is that true ??


BR
Peter


Steven Cheng said:
Hi Peter,

As for WCF over MSMQ, the messages it transfers is still WCF format
messages(based on the Binding and configuration you use), MSMQ is used as
an transport layer here. Sure, the message size will become larger since
it
contains WCF message envelope, and also has other additional overhead due
to the WCF processing pipeline(such as those message processing stacks at
server and client-side).

There does exists some information about optimizing the WCF over MSMQ:

#How can I speed up message processing when using MSMQ with WCF?
http://blogs.msdn.com/drnick/archive/2007/05/07/optimizing-msmq.aspx

However, I'm wondering whether WCF is actually necessary for your
scenario?
If the data transfer doesn't quite rely on the WCF features(such as http
transfer, message security.... ), then you can consider still directly use
System.Messaging namespace classes to do the raw MSMQ programming. If
instead, you want the WCF service side keep using WCF, and the client-side
sending the raw MSMQ message, you can consider using the
MsmqIntegrationBinding. Here are some reference and examples:

#How to: Exchange Messages with WCF Endpoints and Message Queuing
Applications
http://msdn2.microsoft.com/en-us/library/ms789008.aspx

#SOA'izing MSMQ with WCF (and Why It's Worth It)
http://code.msdn.microsoft.com/msmqpluswcf

Anyway, when using WCF it does add some overheard due to the additional
services/features WCF processing pipeline and message envelope attach.

Sincerely,

Steven Cheng

Microsoft MSDN Online Support Lead


Delighting our customers is our #1 priority. We welcome your comments and
suggestions about how we can improve the support we provide to you. Please
feel free to let my manager know what you think of the level of service
provided. You can send feedback directly to my manager at:
(e-mail address removed).

==================================================
Get notification to my posts through email? Please refer to
http://msdn.microsoft.com/subscriptions/managednewsgroups/default.aspx#noti f
ications.

==================================================
This posting is provided "AS IS" with no warranties, and confers no
rights.




--------------------
From: "Peter Larsen [CPH]" <[email protected]>
Subject: WCF and MessageQueue
Date: Thu, 10 Apr 2008 11:04:59 +0200

Hi,

How do i send MSMQ messages using the old way
(System.Messaging.MessageQueue) to a host that use WCF ??
Messages sent through WCF are much bigger than messages created/sent
through
MessageQueue.

Is there a way to exchange messages between the two systems ??

BR
Peter
 
Hi Steven,

Thank you for your reply.
I am not working with this the next two weeks from now.
I still want to find a solution to this, but i have to change focus for a
short period of time.

I appreciate your help.
BR
Peter
 
Hi Peter,

Thanks for your followup.

Sure, no problem. If you need further help later, welcome to post here or
ping me via the email in last message(I can send you my test solution).

Sincerely,

Steven Cheng

Microsoft MSDN Online Support Lead


Delighting our customers is our #1 priority. We welcome your comments and
suggestions about how we can improve the support we provide to you. Please
feel free to let my manager know what you think of the level of service
provided. You can send feedback directly to my manager at:
(e-mail address removed).

==================================================
Get notification to my posts through email? Please refer to
http://msdn.microsoft.com/subscriptions/managednewsgroups/default.aspx#notif
ications.

==================================================
This posting is provided "AS IS" with no warranties, and confers no rights.

--------------------
From: "Peter Larsen [CPH]" <[email protected]>
References: <#tL#[email protected]>
<[email protected]>
 
Back
Top