BizTalk Content Based routing issue - wcf

I have hit upon a weird problem when trying to use content based routing in BizTalk 2013.
If I have a WCF-BasicHTTP static one-way send port that is subscribing to a message returned from a WCF-BasicHTTP static solicit/response send port, it works fine - my web service is executed as expected.
However, if I have a WCF-BasicHTTP static solicit/response send port that is subscribing to a message returned from a WCF-BasicHTTP solicit/response send port, the webservice executes as expected, but the returning message does not appear. There is no corresponding tracked message event for the expected receive. I have debugged the destination webservice and can confirm that it executes and returns the xml document as expected.
In both instances, I am using the XMLTransmit and XMLReceive pipelines.
Furthermore, I have noticed that any send port that subscribes to a message returned from another send port does not have it's adapter details displayed within it's corresponding transmission tracked message event, the adapter value is blank. I am not sure if this is a clue, but it doesn't seem right.
Can content based routing be used in this way?
Thanks in advance

If you have a solicit/response port subscribing to the request of another solicit/response port, then the response of the subscribing solicit/response port should automatically be routed back to the original port. You should not need to subscribe to the response of the second solicit/response port.

Related

Server Sent Events using Spring WebFlux, EventSource and RabbitMQ

I want to create live notifications for my website.
Reference link: http://sinhamohit.com/writing/spring-boot-reactive-sse
Above link contains example for SSE and Event Source. The stream of objects is created to create Flux stream.
In my case, I want to create server sent events and send them to RabbitMQ server, the rest controller should be able to listen to message queue and receive the message.
Right now I am able to receive the messages, but I am not sure how I can convert them into Flux and send the stream to rest URL.
How should I do it?
Refernces, links and examples will be great.
Refer following link, here activemq is used but you can also use RabbitMQ.

RabbitMQ is sending the request again if response is null

I am using RabbitMq with masstransit for messaging between different services, let us say that we have the following scenario:
First service asks about specific info from second service by sending a request.
Second service looks for the info in database and respond with an object containing the found info.
In case there is no info available in database, the second service responds with a null object.
The issue is that RabbitMQ is considering that the request has failed thus it keeps sending the request again.
Can I configure the bus to consider the null reponse as a normal response?
You cannot reply with null object. You have two options:
Add a boolean property to your response indicating it is not a success
Throwing an exception in the request consumer, then the fault message will be sent to the request client.

receiving an input file dynamically and put my mule application in listening

Scenario:
- An application want to send a push to a list of device.
- so she sends information to my mule application which must be listening to the arrived information.
- My application will send this information via web service to the application which will send the push and then my application will wait for a response which is a json file with content: success: 0/1 failed: 0/1,
- according to this answer my mule application will send email which i take from the database, if the device concerned didn't receive the push.
I have done the last part of this scenario. from the receipt of the answer of the push. Now I have some questions about the first part:
I guess that the application sends a json file that contains a list of information of each device.
How processed the list of information devices. I must loop on the contents of the json file. any example of this?
How to put my application in listening for the arrivals request for sending push?
is the http connector sufficient? if so how to configure the path variable.
I'm using mule 3.5.0 CE, Thank you in advance.
Lets break this down, to the various components:
Sender Application - this is the service that needs to communicate with the devices.
Device Controller - this is the application that talks to the hardware devices.
Proxy - this is what you are developing on the Mule ESB. It will connect to both the Sender Application, and the Device Controller and transfer the request from Sender to Controller; and then send the results from the Controller back to the Sender.
The flow would look something like this:
Sender Application needs to communicate with devices.
Sender Application transmits information using JSON.
Proxy receives this JSON request.
The Proxy then contacts the Device Controller over HTTP.
The Device Controller only talks to the Proxy, and returns a result of 0 or 1 depending on the result from the physical device.
The Proxy then needs to communicate this result to the Sender Application.
At first, you might think to develop your Proxy over HTTP (using the HTTP Connector). This connector creates a web service endpoint (a website, basically) that can listen and respond to requests.
The Sender Application connect to this endpoint over HTTP and submits the JSON document containing the commands to be executed.
Your proxy then immediately contact the Device Controller (again, over HTTP using the same connector).
The device controller talks to the devices, and then returns the response to your Proxy (over HTTP).
You take this response and then send it back as the response to the original HTTP request (from the Sender Application).
The problem here is if there is any delay between your connection and the Device Controller (or the Device Controller and the physical devices), the connection will remain blocked on both sides (since you need to send a response).
If there is a large delay the HTTP connection between your Proxy and Sender Application may terminate.
This is the same when some site is overloaded and doesn't respond - eventually the browser will timeout.
To avoid this scenario, split your integration into three separate flows.
The first flow will create a normal HTTP connection to which the Sender Application will upload the JSON document. It will take the JSON document and convert each entry into a message using the batch module (note: this is only available in the Enterprise edition - for the CE version you'll have to code this logic yourself). Next, take this message and put them in a separate queue. Return the unique ID of this message as a JSON response back to the Sender Application.
Your second flow is listening on this queue and whenever a message arrives, it connects to the Device Controller and gets the response. The response is then written to another queue.
Your third and final flow listens on this results queue, takes each message on this queue and converts it to JSON/XML. It then has a HTTP connector where it can be queried for results for each command.
In the above setup, your Sender Application can drop a large JSON file of commands to be executed; for each command, a unique ID will be returned to the Sender Application.
It will then query the result endpoint (what your last flow exposes) and send it the message ID. The result endpoint will then check the status of this request and respond with the appropriate code.
Here is an example of how this would work (from the point of view of the Sender Application):
I is the input to your flow, O is the result sent.
Step 1 - send a request for commands to be executed:
I: Sender Application > http://localhost:8080/input-commands?device=1&command=Y
O: <command><req-status>OK</req-status><id>1234-123</id></command>
Step 2 - Query results:
I: Sender Application > http://localhost:8080/result?id=1234-123
O: <command><id>1234-123</id><result>0</result></command>

How to receive webhook signal from 3rd party service

I'm using a SaaS for my AWS instance monitoring and Mandrill for email sending/campaigns.
I had created a simple chart with Zapier but I'd rather like to host it myself. So my question is:
How can I receive a webhook signal from Mandrill and then send it to Datadog from my server? Then again I guess hosting this script right on the same server I'm monitoring would be a terrible idea...
Basically I don't know how to "receive the webhook" so I can report it back to my Datadog service agent so it gets updated on their website.
I get how to actually report the data to Datadog as explained here http://docs.datadoghq.com/api/ but I just don't have a clue how to host a listener for web hooks?
Programming language isn't important, I don't have a preference for that case.
Here you can find how to add a new webhook to your mandrill account: https://mandrillapp.com/api/docs/webhooks.php.html#method=add
tha main thing here is this:
$url = 'http://example/webhook-url';
this is your webhook URL what will process the data sent by mandrill and forward the information to Datadog.
and this is a description about what mandrill will send to your webhook URL: http://help.mandrill.com/entries/21738186-Introduction-to-Webhooks
a listener for webhooks is nothing else then a website/app which triggers an action if a request comes in. Usually you keep it secret or secure it with (http basic) authentication. E.g. create a website called http://yourdomain.com/hooklistener.php. You can then call it with HTTP POST or GET and pass some data like hooklistener.php?event=triggerDataDog or with POST and send data along with the body. You then run a script or anything you want to process that event.
A "listener" is just any URL that you host where you can receive data that is posted to it. Keep in mind, since you mentioned Zapier, you can set up a trigger that receives the webhook data - in this case the listener URL is provided by Zapier, and you can then send that data into any application (or even post to another webhook). Using Zapier is nice because it doesn't require you to write the listener code that receives the hook data and does something with it.

How to send signed messages in BizTalk Server using WS-Security

I want BizTalk to send signed soap messages using WS-Security without encryption.
My orchestration is using a dynamic send port. I have tried both, trying to configure a WCF-WSHttp Send Port like this: (temporarily altered my orchestration to use this port rather than a dynamic port) as well as doing it within my orchestration.
However I only manage to get my message send out encrypted, or in plain text without being signed or encrypted.
Configuring a Send Port.
Result: Message gets encrypted:
Doing it within my Message Assignment Shape:
Result: Message gets encrypted:
myMessage_Request(WCF.TransportProtectionLevel)="Sign";
myMessage_Request(WCF.MessageClientCredentialType)="Certificate";
myMessage_Request(WCF.TransportClientCredentialType)="Certificate";
myMessage_Request(WCF.OpenTimeout)= "00:10:00";
myMessage_Request(WCF.CloseTimeout)= "00:10:00";
myMessage_Request(WCF.SendTimeout)= "00:10:00";
myMessage_Request(WCF.MaxReceivedMessageSize)= 2147483647;
myMessage_Request(WCF.SecurityMode)="Message";
myMessage_Request(WCF.BindingType)="customBinding";
myMessage_Request(WCF.Action)="http://MySoapAction";
myMessage_Request(BTS.Operation)=”MySoapOperation”;
myMessage_Request(WCF.ClientCertificate)="xxxxxxxx";
myPort(Microsoft.XLANGs.BaseTypes.Address) = http(s)://targeURI
myPort(Microsoft.XLANGs.BaseTypes.TransportType) = "WCF-WSHttp";
If I change the above property WCF.TransportProtectionLevel from “Sign” to “None” the message doesn't get encrypted and also not signed.