GettingStarted With123
GettingStarted With123

Reputation: 427

mule 4 http listener - reconnection when to use?

Using mule 4.4 runtime community edition on premise

Am trying to understand HTTP Listener better and came across this attribute: Reconnection enter image description here

Documentation says:

When the application is deployed, a connectivity test is performed on all connectors. If set to true, deployment will fail if the test doesn’t pass after exhausting the associated reconnection strategy

Now if this was a Database or Messaging broker connector I can relate to 'reconnection' , but in case of HTTP Listener what is it really connecting to ?

Does 'connection' here really mean the ability for the api to listen / serve incoming requests at specified port ( I am assuming that is what it means )

So if for some reason while the api was being deployed it could not come up then we can use this 'retry' mechanism ?

Upvotes: 2

Views: 877

Answers (2)

Rahat Rajdev
Rahat Rajdev

Reputation: 433

The reconnection strategy is not applicable to the MuleSoft HTTP Connector. It's important to understand that the HTTP protocol is inherently stateless, and therefore, the reconnection strategy is not intended for use with HTTP Requester/Listener components.

Although these fields are visible in the SDK (template connector config), they cannot be selectively removed for the HTTP Connector operation. For more information, please consult the official documentation at this link: https://docs.mulesoft.com/http-connector/1.7/http-documentation#request

Please take note of the information provided in the MuleSoft HTTP Connector documentation: "This field is not used by this operation." (as indicated below).

enter image description here

Will recommend exploring the article linked below, which explains how to implement the "Until successful" scope to enable retry functionality for HTTP Request operations.

How to Retry a Failed HTTP Request Due to HTTP:CONNECTIVITY or Other Errors in Mule 4

Thank you!

Upvotes: 0

aled
aled

Reputation: 25664

Sources in connectors -the HTTP Listener in this case- that use connections need to obtain their connection objects. The HTTP Listener is not trying to connect to an external server but needs to setup the HTTP server connection. If there is an error the source may attempt to reestablish the connection. It doesn't mean that it will reach out, just that the 'connection' object is correctly setup and error handling is taking place as the documentation links explain.

Upvotes: 1

Related Questions