Validate exchange, routing key when publishing message using Spring RabbitMessagingTemplate - spring

Is there a way to validate that the exchange and routing key/queue when sending message using RabbitMessagingTemplate? Currently, there is a default exchange and routing key which blank string and there's no error being thrown.
messagingTemplate.convertAndSend(message.getExchange(), message.getRoutingKey(), message.getPayload());

Please, see Returns and Confirms callback: https://docs.spring.io/spring-amqp/docs/2.1.2.RELEASE/reference/html/_reference.html#template-confirms. So, if there is anything wrong with exchange or queue on the routing key, you’re going to have message returned with an error

Related

"Subscription validation request failed. Notification endpoint must respond with 200 OK to validation request"

I finished this tutorial https://learn.microsoft.com/en-us/graph/tutorials/azure-functions?tutorial-step=5 everything worked fine until i published my azure Functions in my Azure App.
When i try to make the subscription i get this error "Subscription validation request failed. Notification endpoint must respond with 200 OK to validation request". When i test with ngrok i can create the subscription with no problems but when i replace NgrokURL value for my Azure function Url, not. Is that the right way to create the susbcription? Also i tried to create the subscription in Graph Explorer but i still get this message.
As the same question raised in MSFT Docs Q&A Forum and thanks to the Shwetachoudhary provided the solution that helps other community members:
In the following below code,
content type must be text/plain.
body must include the validation token.
CodeSamples
asp .net mvc sample - Specifically look at the NotificationController.cs file
In the method
[HttpPost]
public async Task<ActionResult> Listen()
{
if (Request.QueryString["validationToken"] != null)
{
var token = Request.QueryString["validationToken"];
return Content(token, "plain/text");
}
'notificationUrl' must be able to respond to the request for validation. Make sure the validation token returns as plain/text as well. Refer to the Notification endpoint validation document provided by Microsoft.
Try isolating the code and calling the same API with Postman or Graph Explorer and see the results.

ActiveMQ OpenWire: How can I send the Java custom fields of an Exception thrown in BrokerFilter.send to the client/producer JVM side?

In order to create the functionality of listening on the client (producer/consumer) side to custom Exceptions thrown in broker plugins we're trying to relay a "custom correlation id" created upon message send, attached as property to the message and also attached to a JVM structure together with the callback to be called upon that exception being raised (a listener).
The things works, but the only issue we have is that we cannot send that custom correlation id back as part of the exception - it is a custom field, and by default OpenWire only transmits the stack and the message, is that correct?
What possibilities do you suggest to work this out, and be able to transmit back custom fields/values (other than encoding them in the message)?

no SOAPAction header! in Oracle service bus

I am facing below error in respose,
<faultcode xmlns:ns1="http://xml.apache.org/axis/">ns1:Client.NoSOAPAction</faultcode>
<faultstring>no SOAPAction header!</faultstring>
i am trying to fixing in pipeline ,
selected pass all headers through pipeline but didn’t helpedenter image description here
Do you really need a SoapAction?
One of the options available in a proxy is to decide which operation a SOAP message is, by inspecting the message body.
If someone sends a message (perhaps through a biz ref) and doesn't include a SOAP action header, a proxy will still recover if it uses this method.

How to add the unhandled exceptions accross the applications in response body in WEB API

How to add the unhandled exceptions accross the applications in response body in WEB API. If there is no exceptions a success message needs to be sent to the response body for all the responses....Need help on achieving this.
You need two things. For handling the exceptions, you need to set the IncludeDetailErrorPolicy in the HttpConfiguration object,
You can configure the error policy preferences as part of the configuration object (HttpConfiguration) in the IncludeErrorDetailPolicy property. This is just an enum that instructs Web API about how to deal with exceptions.
The possible values for this enum are,
Default: It’s uses the customErrors configuration settings if you are using ASP.NET as host or LocalOnly for self-host.
LocalOnly: Only includes error details for local requests
Always: Always includes error details
Never: Never includes error details
When an exception happens, Web API will check the value on this setting for including details about the exception in the response message or not. For example, if Always is enabled, Web API will serialize the exception details as part of the message that you get as response.
The success message does not make much sense as you already have the response status code. A status code equals to OK means that everything went ok. If you still want to add an additional message, use a HttpMessageHandler that checks for the response status code. If the status code is OK, add the message. However, the response body has been set already at that point so you will not able to modify it. You might able to add a message as a header.

Cocoa asyncsocket class problem

Hey I am making server client system with asyncsocket class for cocoa, I really don't get it, do I have to send a message to the server in order to receive something, it seems so. Server should send me a message when I connect, but I won't get anything unless I send the server a message which goes pretty strange, same applies, I have to send another message to get a message?
Here is server code, as you see it should send a message when someone connects, which it doesn't do unless I send it a message from client. See code for server
Here is code for client where I send two messages to receive messages from the server.
See client code here: http:://pastebin.com/1B7qy9R2 remove other : from link as it's my first post so no 2 link allowed :(
I either have understood the asyncsocket wrongly or there is a bug, but if someone would help it would be appericiated.
You don’t have to send data before you can receive some. This happens in your code, because you are only calling readDataWithTimeout:tag: in your onSocket:didWriteDataWithTag: delegate method.

Resources