Skip to content

Add support for SB-Messaging adapter (empty message body rather than null) #187

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
jcools85 opened this issue Apr 7, 2020 · 10 comments · Fixed by #188
Closed

Add support for SB-Messaging adapter (empty message body rather than null) #187

jcools85 opened this issue Apr 7, 2020 · 10 comments · Fixed by #188
Labels
Milestone

Comments

@jcools85
Copy link

jcools85 commented Apr 7, 2020

I'm using ServiceBus.AttachmentPlugin in a hybrid integration solution, and my consumer (in this case BizTalk's SB-Messaging adapter) doesn't like the ServiceBus message body being null.
I can replace the message body stream in the receive pipeline to let my flow work, but the SB-Messaging adapter still logs an error in the eventlog:

The Messaging Engine received an error from transport adapter “SB-Messaging” when notifying the adapter with the BatchComplete event. Reason “Object reference not set to an instance of an object.”.

Proposed solution:
Add an option to the AzureStorageAttachmentConfiguration constructor to avoid an empty message body when sending a message. For example, the blob.Name that is written to the custom property could also be written to the ServiceBus Message Body.

@SeanFeldman
Copy link
Owner

@jcools85 would an empty byte array work for your scenario?

@jcools85
Copy link
Author

jcools85 commented Apr 8, 2020

@SeanFeldman yes, just tested with an empty byte array and that seems to work.

@SeanFeldman
Copy link
Owner

@jcools85 have a look at the change here. This would need to be an opt-in configuration. Would that work for your scenario?

@SeanFeldman
Copy link
Owner

Also, would it be correct to say that this issue adds support for "BizTalk's Service Bus Messaging adapter"?

@jcools85
Copy link
Author

jcools85 commented Apr 9, 2020

Looks good! That would indeed work for my scenario.
And yes, you could say this adds support for the SB-Messaging adapter, because besides this little issue it works perfectly. You do however have to build the "receive" logic in BizTalk. But a simple pipeline component that replaces the body stream with a new stream from blobstorage does the trick.

@SeanFeldman
Copy link
Owner

Looks good! That would indeed work for my scenario.

Great. I'll release that over the weekend.

And yes, you could say this adds support for the SB-Messaging adapter, because besides this little issue it works perfectly.

Great. I love to see CodeIt leveraging this plugin for various solutions.

You do however have to build the "receive" logic in BizTalk. But a simple pipeline component that replaces the body stream with a new stream from blobstorage does the trick.

That's likely due to the fact that the receiving part of the SB-Messaging adapter assumes the body is always there. Which is OK as long as the BT pipeline allows you to have the step before to consolidate the payload and the message.

@SeanFeldman SeanFeldman changed the title Consider adding an option to not send ServiceBus messages with body=null Add support for SB-Messaging adapter (empty message body rather than null) Apr 9, 2020
@SeanFeldman SeanFeldman added this to the 6.2.0 milestone Apr 9, 2020
@jcools85
Copy link
Author

jcools85 commented Apr 9, 2020

Great. I love to see CodeIt leveraging this plugin for various solutions.

Thanks for handling this request so swiftly @SeanFeldman !
Will be used in production at one of our customers before summer :)

@SeanFeldman
Copy link
Owner

@jcools85 do you mind to share your Twitter account (for credits)?

@jcools85
Copy link
Author

@jcools85 do you mind to share your Twitter account (for credits)?

Sure! my twitter handle is @jcools85 as well. I just followed you, was surprised to see I wasn't following you there already, because you do pop up on my feed a lot :D

@SeanFeldman
Copy link
Owner

Found an issue with the body replacer. Will release once the other PR for the milestone is closed.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants