Spring Integration - Outbound Gateway - Chaining - spring

I have a FileUpload Event that should be sent over to a http:outbound upload URL. In order to do this I have to first authenticate login URL and get the response and set the session id for outbound upload URL to execute. In my case, I have an event listener which listens for the application to publish the event of File Upload. Once it is published my listener can pick up and execute the flow. I am trying to see how this can be implemented because File Upload object would need to persisted until the Login response comes back. Thanks!

For this purpose we suggest a Header Enricher pattern. So, you place that "FileUpload Event" object into some header and restore it back to the payload when you get that session id response.
So, you add a Header Enricher before first HTTP Outbound Gateway.
After this gateway you rearange your message to place that header back into a payload and do something with a session id. (Header I guess?). And only after that your have another HTTP Outbound Gateway for uploading your file.

Related

How to perform a GET request after a POST request with web-sockets

I am currently trying to build a go API using gin for a web and mobile application. I am new to the world of WebSockets and Go so I was wondering how I would go about triggering a GET request from the client after a relevant POST request was made ie: the POST request contained the user's ID so the clients who require information regarding that user are properly updated. Currently, I have the POST and GET requests which do what I need them, but I'm a little lost about how to make the entire flow realtime using WebSockets.
I believe this example of server-sent-events should address the question. Once a POST handler has been called, send a flag to the GET endpoint via a channel and then send an event through there.

How to handle callback return response in Jmeter

In my REST POST/PUT request I will send callback url with additional data
Once backend server responded with success or failure, i will get response to my callback url.
How can see what response in callback url in Jmeter. Based on response I process further
If this is a 3rd-party URL there is no possibility to intercept the request from your backend to this callback URL with JMeter
If you can change the callback URL to an arbitrary value you can use i.e. HTTP Mirror Server as the callback URL, this way your backend will send the request to JMeter instead of the 3rd-party URL so you will be able to get the status and eventually re-send the request to the callback URL so it won't be lost.
If this is not possible you can investigate where the information about the job status is stored, if it can be found in a log file you can use OS Process Sampler or SSH Command sampler to get it, if it's in the database - you can retrieve it using JDBC Test Elements, etc.

Messaging in xmatters through API call

I am trying to message or send alert in Xmatters using API in postman. This call was successful and an Id also generated in response, but the message was not reached to the Targeted person.When I did it from UI the mail was sent to the targeted person.
What was the endpoint of your API? Were you targeting an inbound integration endpoint (api/integration/functions/UUID/triggers), or the form endpoint (/reapi/yyy-mm-ddd/forms/UUID/triggers)? If you target the inbound integration endpoint, you will get a UUID returned while the form endpoint will return an event ID.
If an event was created, you will see an entry in the reports tab of the UI for that event and it will have any errors around notifying users.

Customize OSB Mail alert body content

I am using Mail as alert-destination in OSB. From proxy service I am calling the alert destination and mail is being sent successfully.
However, the mail content is showing the details of service, destination, timestamp, server name etc details.
I just want to have the payload information in the mail body.
Is therey any way to customize the mail body when adding alert action in a proxy service?
Thanks in advance
The Alert action is very basic, and the email destination isn't really designed to be consumed by humans directly.
You're probably better off alerting to a JMS destination, then dequeuing it using a proxy to transform it into exactly what you want, then route to an SMTP Messaging business service to deliver the email (presumably formatted in HTML).

Shopify webhook verification in parse

I am trying to get a shopify webhook to fill my customer class in parse.com, however something must go wrong. I don't know how to verify the parse response since Shopify sends this webhook out from it's ruby backend. I used requestbin to catch the webhook and I replicated a post request using postman to my parse url and everything works fine. Does anyone know how to debug requests like these? Is there a console in Parse where I can see all the incoming requests and the responses Parse.com sent back?
Try using Runscope for debugging webhooks. Full guide here: https://www.runscope.com/provider-guide/troubleshooting-webhooks - this is more than just a request bin. It's a full transparent proxy that will, like a bin, record the webhook notification, but will also pass it along to the intended destination (your webhook receiver) and record that response as well.

Resources