Discussion:
Submitting a message from a send adapter
(too old to reply)
Waqar Sadiq
2008-07-14 13:03:52 UTC
Permalink
I have a custom SEND adapter. This adapter processes files. The adapter is
developed to process a large number of messages - into millions. Large
files get dropped in the drop locations being monitored by receive FILE
adapters. They debatch them into single messages and publish them to the
message box. The send adapter keeps processing the messages as it receives
them. It does not respond to each message but rather when it determines
that it has processed the last message from a file, it is supposed to
generate a single message that contains the summary of the file processed.
The idea is that this summary message can then be subscribed to by a receive
port that can put it in a file or alternatively an orchestration can take
that message and generate a more detailed acknowledgement or file processing
report from it. In either case, the SEND adapter does not care.

I am using the Microsoft's custom adapter framework to develop my adapter.

I have got 2 questions.

1) The adapter framework allows you to return response of a message.
However, in my case the repose to processing each message is null because I
do not have a single response to each message. Instead, my adapter starts a
timer and resets it each time it receives a message. After a preconfigured
length of time has passed without receiving another message from that batch,
it determines that all messages from the file have been processed. It then
generates that message. How do I publish this summary message to the
message box?
2) I am noticing that the incoming messages are being put in the suspended -
resumable state. What do I need to do to delete those messages.

Thanks.
Waqar Sadiq
2008-07-14 15:17:33 UTC
Permalink
I do not need the answer to my second question. I had a test port that was
listening to the messages and was in stopped state. I still am looking for
an answer to my first question though.

Thanks.
Post by Waqar Sadiq
I have a custom SEND adapter. This adapter processes files. The adapter
is developed to process a large number of messages - into millions. Large
files get dropped in the drop locations being monitored by receive FILE
adapters. They debatch them into single messages and publish them to the
message box. The send adapter keeps processing the messages as it receives
them. It does not respond to each message but rather when it determines
that it has processed the last message from a file, it is supposed to
generate a single message that contains the summary of the file processed.
The idea is that this summary message can then be subscribed to by a
receive port that can put it in a file or alternatively an orchestration
can take that message and generate a more detailed acknowledgement or file
processing report from it. In either case, the SEND adapter does not care.
I am using the Microsoft's custom adapter framework to develop my adapter.
I have got 2 questions.
1) The adapter framework allows you to return response of a message.
However, in my case the repose to processing each message is null because
I do not have a single response to each message. Instead, my adapter
starts a timer and resets it each time it receives a message. After a
preconfigured length of time has passed without receiving another message
from that batch, it determines that all messages from the file have been
processed. It then generates that message. How do I publish this summary
message to the message box?
2) I am noticing that the incoming messages are being put in the
suspended - resumable state. What do I need to do to delete those
messages.
Thanks.
Tomas Restrepo [MVP]
2008-07-15 03:08:25 UTC
Permalink
Waqar,
Post by Waqar Sadiq
1) The adapter framework allows you to return response of a message.
However, in my case the repose to processing each message is null because
I do not have a single response to each message. Instead, my adapter
starts a timer and resets it each time it receives a message. After a
preconfigured length of time has passed without receiving another message
from that batch, it determines that all messages from the file have been
processed. It then generates that message. How do I publish this summary
message to the message box?
In your case, you can't really use a two-way send adapter. Sounds to me like
what you really want is to create a parallel receive-only adapter that
receives your "termination notification" messages from the send adapter
through some sort of IPC (could be as simple as custom event, a simple
remoting call, whatever) and submits it as a new message to BizTalk.

It shouldn't be hard to do...
--
Tomas Restrepo
http://www.devdeo.com/
http://www.winterdom.com/weblog/
Waqar Sadiq
2008-07-15 13:15:14 UTC
Permalink
Tomas,

So a SEND adapter is not allowed to publish a message to the Message Box?
Creating a parallel adapter can be easy. I can just put the notification
message in a file and configure a RECEIVE adapter with a FIEL adapter to
publish the message. It just seems like a round-about way of accomplishing
a simple thing.

I will take your suggestion and do it accordingly.

Thanks.
Post by Tomas Restrepo [MVP]
Waqar,
Post by Waqar Sadiq
1) The adapter framework allows you to return response of a message.
However, in my case the repose to processing each message is null because
I do not have a single response to each message. Instead, my adapter
starts a timer and resets it each time it receives a message. After a
preconfigured length of time has passed without receiving another message
from that batch, it determines that all messages from the file have been
processed. It then generates that message. How do I publish this
summary message to the message box?
In your case, you can't really use a two-way send adapter. Sounds to me
like what you really want is to create a parallel receive-only adapter
that receives your "termination notification" messages from the send
adapter through some sort of IPC (could be as simple as custom event, a
simple remoting call, whatever) and submits it as a new message to
BizTalk.
It shouldn't be hard to do...
--
Tomas Restrepo
http://www.devdeo.com/
http://www.winterdom.com/weblog/
Tomas Restrepo [MVP]
2008-07-15 13:46:15 UTC
Permalink
Waqae,
Post by Waqar Sadiq
So a SEND adapter is not allowed to publish a message to the Message Box?
Not on it's own, no. That's why it's a send adapter :) To be fair to
BizTalk, it's the same way in most other messaging technologies (including
WCF and JBI, btw), and does make kind of sense, btw, if you realize that
send and receive adapters interact with the messaging engine in fairly
different ways (even if both use the same API).
Post by Waqar Sadiq
Creating a parallel adapter can be easy. I can just put the notification
message in a file and configure a RECEIVE adapter with a FIEL adapter to
publish the message. It just seems like a round-about way of
accomplishing a simple thing.
That's probably easier, yes.
--
Tomas Restrepo
http://www.devdeo.com/
http://www.winterdom.com/weblog/
Loading...