简体   繁体   English

直接发送消息到BizTalk或通过MSMQ?

[英]Sending message directly to BizTalk or via MSMQ?

This is the first time I'm using BizTalk for cross-machine, asynchronous, reliable communication. 这是我第一次使用BizTalk进行跨计算机,异步,可靠的通信。
I would like to know is there a way to directly send messages from one machine to BizTalk queue or I have to use local MSMQ which in turn sends messages to BizTalk? 我想知道是否有一种方法可以将消息从一台计算机直接发送到BizTalk队列,或者我必须使用本地MSMQ,后者又将消息发送到BizTalk?

In C#, is there a binding that is used in order to send messages to BizTalk queues? 在C#中,是否存在用于将消息发送到BizTalk队列的绑定?
For MSMQ I know that there is NetMsmqBinding. 对于MSMQ,我知道有NetMsmqBinding。

Cheers 干杯

Update: 更新:

Since I've introduced a bit of confusion, I'll try to explain a bit and please correct me if I'm wrong. 由于我引入了一些困惑,因此我将尝试解释一下,如果我做错了,请纠正我。
As far as I know, ESBs implement the concept of queues or message channels that can be used for reliable, asynchronous communication (messaging in short). 据我所知,ESB实现了可用于可靠的异步通信(简称消息传递)的队列或消息通道的概念。 Now, I'm having difficulty placing BizTalk into this concept. 现在,我很难将BizTalk纳入这个概念。 There are dozens of interpretation of ESB concept and same number of opinions on if BizTalk is an ESB, like Sonic or TIBCO... ESB概念的解释有数十种,关于BizTalk是ESB的观点也很多,例如Sonic或TIBCO。
Now, as far as I know, for example in TIBCO which implements JMS API, there are no queues or queueing services on local client machine (eg MSMQ), but they are present and configured on TIBCO ESB and from client app I use JMS API to send messages to these queues. 现在,据我所知,例如在实现JMS API的TIBCO中,本地客户端计算机(例如MSMQ)上没有队列或排队服务,但它们在TIBCO ESB上存在并已配置,并且在客户端应用程序中,我使用JMS API将消息发送到这些队列。
So when I want to communicate via BizTalk with apps on different machines and I want to use messaging, I'll be using MSMQ on local machine and MSMQ will transfer these messages to BizTalk and other apps downstream? 因此,当我想通过BizTalk与其他计算机上的应用程序进行通信并且要使用消息传递时,我将在本地计算机上使用MSMQ,MSMQ会将这些消息传输到BizTalk和其他下游应用程序吗?
Also, where should I configure the communication between local MSMQ and BizTalk? 另外,我应该在哪里配置本地MSMQ和BizTalk之间的通信? Should I configure BizTalk to listen to a given MSMQ for new messages or there is some configuration that should take place on MSMQ itself, as well? 我应该配置BizTalk来侦听给定的MSMQ以获得新消息,还是应该对MSMQ本身进行一些配置?

BizTalk communicates with the outside world through artefacts called adapters , which can provide an endpoint visible to the outside world over a wide range of messaging protocols. BizTalk通过称为适配器的伪像与外界进行通信,这些伪像可以通过各种消息传递协议提供对外界可见的终结点。

There is an MSMQ adapter, which seems to be able to read from and publish to queues on either the local computer or a remote computer. 有一个MSMQ适配器,它似乎可以从本地计算机或远程计算机上读取并发布到队列。 I've never used it, so I'm coming from a position of reading the docs on this adapter and finding out as I go along. 我从来没有使用过它,所以我是从阅读此适配器上的文档并逐步了解的角度出发的。 I've found the BizTalk documentation to be particularly difficult to navigate, particularly as a lot of the microsoft links now go nowhere in particular - it took a little while to find these pages I've mentioned. 我发现BizTalk文档特别难以浏览,特别是因为许多microsoft链接现在都无处可去-找到我提到的这些页面花了一些时间。 Do let me know if you find anything kicking around that's not obvious as I'm sure there are useful resources I've never been able to find. 如果您发现有什么不明显的事情发生,请告诉我,因为我确信有一些我从未找到过的有用资源。

To configure BizTalk to listen to a queue: 要配置BizTalk以侦听队列:

  • Create a One-Way Receive Port 创建一个单向接收端口
  • Create a One-Way Receive Location associated with that port 创建与该端口关联的单向接收位置
  • Set the receive location's transport Type to 'MSMQ' 将接收位置的传输类型设置为“ MSMQ”
  • Click 'configure' 点击“配置”
  • Specify the credentials to use and the queue name (which includes the machine name, implying that it works equally well on remote queues) 指定要使用的凭据和队列名称(其中包括计算机名称,这意味着它在远程队列上同样有效)
  • Set the other properties appropriately to your scenario 根据您的情况适当设置其他属性

That should be all there is to it. 应该就是它的全部了。 Publishing to that queue should then cause a message to be received on that port, which immediately persists it to the message box database. 然后,发布到该队列将导致在该端口上接收到一条消息,该消息立即将其持久化到消息框数据库中。 You'll have to do some processing using pipelines and/or maps in order to do anything useful with the message. 您必须使用管道和/或地图进行一些处理,以便对消息进行任何有用的处理。

However, you are by no means limited to MSMQ. 但是,您绝不仅限于MSMQ。 A pretty comprehensive list is available, and BizTalk doesn't constrain you to any particular messaging protocol. 提供了一个非常全面的列表 ,并且BizTalk并不限制您使用任何特定的消息传递协议。 You can also implement custom adapters with whatever behaviour you need. 您还可以使用所需的任何行为来实现自定义适配器。 In order to answer your question more usefully, it'd be helpful to know what your real requirements are - what's the use case for the client application, for example? 为了更有效地回答您的问题,知道您的真正要求是有帮助的-例如,客户端应用程序的用例是什么?

BizTalk operates off of the concept of Ports - both receive and send. BizTalk脱离端口概念进行操作-接收和发送。 These Ports leverage many different technologies to read and write messages, but none are direct communication with other BizTalk Servers. 这些端口利用许多不同的技术来读取和写入消息,但是没有一个是与其他BizTalk Server的直接通信。 You'll need to leverage something like MSMQ or even basic Web Services - that's up to you - but you'll need some sort of communication protocol in between. 您需要利用MSMQ甚至基本的Web服务之类的东西-由您自己决定-但您之间需要某种通信协议。

"Also, where should I configure the communication between local MSMQ and BizTalk? Should I configure BizTalk to listen to a given MSMQ for new messages or there is some configuration that should take place on MSMQ itself, as well?" “而且,我应该在哪里配置本地MSMQ和BizTalk之间的通信?我应该配置BizTalk以侦听给定的MSMQ以获得新消息,还是在MSMQ本身上进行一些配置?”

Answer: You need to configure BizTalk to poll the respective queue at a defined interval(Can be configured in BizTalk). 答:您需要配置BizTalk以按定义的时间间隔轮询相应的队列(可以在BizTalk中配置)。 In MSMQ you need to grant access rights to the User account which will use when it polls the queue. 在MSMQ中,您需要授予对用户帐户的访问权限,该用户帐户将在轮询队列时使用。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM