Connected Pawns

February 8, 2017

Auckland Connected User Group (ACSUG)

Filed under: Azure, BizTalk — Tags: , , , — mbrimble @ 12:31 pm

We are starting to meet again regularly after a long hibernation.

Thiago Almeida started the group many years ago but it has been in hibernation for  awhile. Mike Howell, Craig Haiden and myself have decided to start it again. We plan to have regular meeting every two months during the year. We have some good speakers lined up and have some fun evenings planned.

If you are interested in joining then join up at https://www.meetup.com/Auckland-Connected-Systems-User-Group/?scroll=true

Brian Lai - Auckland City

The first two sessions promise some exciting action;

Tuesday, February 14, 2017   6:00 PM to 7:30 PM – Steef-Jan Wiggers :: Cloud Integration: so many options!
Saturday, March 25, 2017   8:30 AM to 6:00 PM – Global Integration Bootcamp (AKL)

Credits for the picture go to Brian Lai who works on our support desk. He recently won a photo competition run by Microsoft. If you want to see more of his work then check out these links

Microsoft themes: https://support.microsoft.com/en-gb/help/14014/windows-desktop-themes-from-the-community

and search for:

 “Nature’s Grace” or http://download.microsoft.com/download/1/5/4/154E922A-7744-4474-A95A-5BDC043CDBBE/NaturalGraceBrianLai.themepack

“COMMUNITY SHOWCASE: AQUA 3” or http://download.microsoft.com/download/1/7/A/17ABABA3-79C8-4B6D-AA18-384E33D1B055/CommunityShowcaseAqua3.themepack

“North Island” or http://download.microsoft.com/download/7/2/8/728E3928-EE04-4A76-A09F-2A00EA444432/NorthIslandNZBrianLai.themepack

 

January 9, 2017

Can you use the BizTalk MLLP Adapter as a Socket Adapter?

Filed under: BizTalk — Tags: , , , — mbrimble @ 9:50 pm

I have been doing  proof of concept where a application connects to BizTalk Server using a TCP/IP stream connection where the application will actively connect and BizTalk Server will listen for connections.

I have previously written a custom adapter called the GVCLC Adapter which actively connects to a vending machine. This was based on the Acme.Wcf.Lob.Socket Adapter example by Michael Stephenson. Another alternative that was considered was the Codeplex TCP/IP adapter. When I met Michael for the first time in Sydney two years ago I thanked him for his original post and he said to me why hadn’t I used the BizTalk MLLP adapter instead. In this post I examine whether it is possible to use MLLP adapter to connect to a socket.

The BizTalk MLLP adapter is part of the BizTalk HL7 accelerator. This is usually used with healthcare systems. The MLLP adapter at its essence is a socket adapter as shown by the receive and send port configurations shown below. can it be used for other non-healthcare systems?

imageimage

First I installed the BizTalk 2013 HL7 Accelerator with the minimal options to run the MLLP adapter. I had issues because you cannot install it if all the latest Windows Update have been installed but there is a workaround.

image

I setup a receive location as shown above once the MLLP adapter had been installed. Note i am not using any of the HL7 pipelines, no carriage return character, a custom start character and end character. Next I created a asynchronous socket test client very similar to the the Microsoft example here. I modified it so it would send a heart beat. I added the following lines at the right place

.//Start,End and ACK messages
protected const string STX = “02”;
protected const string ETX = “03”;
protected const string ENQ = “05”;

//…………………………….

// Send test data to the remote device.
//Send(client, “This is a test<EOF>”);
data = (char)Convert.ToInt32(STX, 16) + data + (char)Convert.ToInt32(ENQ, 16) + (char)Convert.ToInt32(ETX, 16);

Now after changing the host to 192.168.1.3, enabling the receive location and starting the socket test client, a ENQ message is received in BizTalk. This proves that the MLLP adapter can consume a socket client with a message that is not a HL7 message.

image

Next i set a file port to send a heartbeat message MLLP send adapter configure to send to 192.168.1.3 as above. The heartbeat message was <STX><ENQ><ETX>. I created a socket server similar to the Microsoft example here. I modified it be adding the following lines

//Start,End and ACK messages
protected const string STX = “02”;
protected const string ETX = “03”;
protected const string ACK = “06”;

//————–

// Echo the data back to the client.
//Send(handler, content);
// Send ACK message back to clinet
data = (char)Convert.ToInt32(STX, 16) + data + (char)Convert.ToInt32(ACK, 16) + (char)Convert.ToInt32(ETX, 16);

On dropping the file in the file receive port it was sent to the MLLP adapter and then sent to the socket server as shown by the printout below. There is five bytes because the configured adapter is also adding an extra STX and ETX character the message.

image

This proves the a MLLP receive adapter can consume messages from a socket client and that a send MLLP adapter can send to a socket server.

We have shown that MLLP adapter can be used instead of the Codeplex TCP/IP adapter or the Acme socket adapter

…….but this is not the end for me. My application wants to be a socket client and for BizTalk to send a heartbeat when it will send an AC i.e.

Application –>connect to BizTalk Server

BizTalk Server –>Message or heartbeat to the application

Application –> ACK message to BizTalk Server

I think I will have to create a custom adapter to do this.

In summary for the basic case the MLLP adapter can be used instead of the Codeplex TCP/IP adapter or the Acme socket adapter.

December 5, 2016

Integrating Apache ActiveMQ with BizTalk Server – Publishing messages

Filed under: BizTalk — mbrimble @ 12:58 pm

This blog will describe how we can publish a message using Biztalk server and the Apache ActiveMQ Rest API.  In previous blog I wrote about consuming a message from a AMQ and in this article show how to do it the other way.

To begin with we tried to use a BizTalk WCF-WebHTTP adapter to POST a message to the AMQ  with a request URL like http://servername:8161/api/message/MISC.MAX.DATA?type=queue&clientId=misc_data_biztalk&message_type=7222&message_version=2. We were pleased to see the message added to the queue with the correct properties. Unfortunately we got a transmission failure like “System.ServiceModel.ProtocolException: An HTTP Content-Type header is required for SOAP messaging and none was found” in the BizTalk group hub even though the message was added to the queue successfully. If we tried the request using fiddler it showed that the response does not contain a Content-Type in the header as well.

image

Getting a transmission failure each time BizTalk posts a message is not acceptable and we searched for a solution. We created a custom behaviour to add this a Content type to the header of the response but the WCF-WebHTTP adapter transmission failure occurs before the message gets to that point. Next we tried to configure the AMQ to add a content type but could not find the correct “config” to edit.

Finally we decided to choose BizTalk HTTP adapter instead of the WCF-WebHTTP adapter to POST the message to the AMQ. The HTTP adapter is a very old adapter and I reasoned that it might not be as picky about what is in the header of the response. It was pleasing to find that the HTTP adapter did  POST a message to the AMQ without a transmission failure. This is a good example of where the HTTP adapter can do something that the modern WCF-WebHTTP adapter cannot do. Thanks to Deepa Kamalanathan for proving all this.

imageclip_image002

In summary we have now shown that you can consume messages from a Apache AMQ with the BizTalk WebHTTP adapter and that you can publish messages to the AMQ with the HTTP adapter. One question remains and that is what throughput can be achieved using these adapters.

December 1, 2016

Elevating permissions for BizTalk Server Operators Group

Filed under: BizTalk — mbrimble @ 4:54 pm

I found this blog article , https://www.codit.eu/blog/2012/07/02/elevating-permissions-for-biztalk-server-operators-group/ by Toon Vanhoutte   very useful today.  Adding this link to my blog so i don’t forget it.

October 20, 2016

BizTalk Documenter for BizTalk Server 2016

Filed under: BizTalk — mbrimble @ 2:03 pm

The BizTalk Documenter has been compiled and refactored for .Net 4.6 and BizTalk 2016 Tap release.
This will only work for BizTalk 2016.

October 11, 2016

Integrating Apache ActiveMQ with BizTalk Server–Memory Issues

Filed under: BizTalk — Tags: , — mbrimble @ 12:08 pm

We followed Mohamed M Malek and used the WCF-WebHTTP adapter to integrate with the Apache ActiveMQ Rest API.  Initially we used a HTTP GET to consume the message but discovered that after a while the central message broker ran out of memory. Researching the Apache documentation we discovered that you can consume messages by browsing to the subscription but you must then DELETE the message when you have finished processing it,  to acknowledge a particular message.

We tried to acknowledge our HTTP GET with a subsequent HTTP DELETE but could not DELETE the message from the queue. It had already been removed from our subscription.

In the end we changed from using a HTTP GET to a HTTP DELETE.  The Apache documentation says you can use either a HTTP DELETE or GET to consume the message. We found that response was identical whether we used GET or DELETE. What was more pleasing was that the memory no longer increased on the central message broker and this solved our issue. Thanks to Deepa Kamalanathan for working all this out.

amg

October 4, 2016

What’s wrong and right with the BizTalk WCF-WebHTTP adapter

Filed under: BizTalk — Tags: , — mbrimble @ 3:15 pm

Colin Dijkgraaf and I presented this on Integration Monday today. In this session we showed why the WCF-WebHTTP adapter requires some workarounds. We used BizTalk 2016 Tap release to demonstrate these workarounds. The presentation and PowerPoint presentation can be downloaded from here.

image

September 18, 2016

Where has my Azure Service Relay gone?

Filed under: Azure — Tags: , — mbrimble @ 8:06 am

The Service Bus Preview does not display Azure Service Bus Relays in my hands.

The Service bus is in preview in the new Azure Portal and I used it to create this service bus. I created a Azure Service bus relay but could not find it  anywhere in the new portal. Without this it is not easy to check whether you have created the relay or not.

image

Thankfully when I checked the old portal I can still see the Azure Service Bus Relay that I created.

image

I hope the Microsoft team fix this before it comes out of preview.

August 2, 2016

My First Logic App

Filed under: Azure, BizTalk — Tags: , , — mbrimble @ 6:11 pm

I really like this logic app pattern.

image

The NZ Post parcel events application (https://www.nzpost.co.nz/business/developer-centre/tracking-notification-api/watch-method) will not repeat an event. I decided to expose http endpoint in an azure Logic App and send these to a Azure Service Bus. I then I retrieve the message using a BizTalk SB-Messaging adapter, whenever I am ready and then do all the heavy lifting.

This was a brilliant experience with a customer in front of me. All done in less than 15 minutes!

July 16, 2016

BAM: “..One of more database(s) appears corrupted..”

Filed under: BizTalk — Tags: — mbrimble @ 6:06 am

I got this error.

image

Checking the event log I saw a BAM Web Service Error like

System.Web.Services.Protocols.SoapException: There are instances with duplicate ID ‘\\MyServer\customer-b2c-dw_wsl_delta201604131734004.xml’ in activity ‘GenericCountOfTrackedMessages’. The duplicates must be removed from the database to fix this problem.

Running the following query showed the duplicates in two of the partitions.

SELECT * FROM [BAMPrimaryImport].[dbo].[bam_GenericCountOfTrackedMessages_20ED6B1B_734C_4980_B213_792B16DF734B] where ActivityID IN (SELECT ActivityID FROM dbo.bam_GenericCountOfTrackedMessages_00C024D3_BCC3_4E02_A428_3358E482BF4F)

image

I decided to delete these duplicates from one of the partitions with

DELETE

–SELECT *

FROM [BAMPrimaryImport].[dbo].[bam_GenericCountOfTrackedMessages_20ED6B1B_734C_4980_B213_792B16DF734B] where ActivityID IN (SELECT ActivityID FROM dbo.bam_GenericCountOfTrackedMessages_00C024D3_BCC3_4E02_A428_3358E482BF4F)

This worked and the query of this BAM activity now works without the above error.

Older Posts »

Blog at WordPress.com.