webMethods API Gateway Q&A - In JMS/AMQP Routing Policy, native is returning ‘504 Gateway Timeout’

Product/components used and version/fix level:

Product webMethods API Gateway (YAI)
Versions 10.7
Platforms All Platforms
Operating Systems All Operating Systems

Detailed explanation of the problem:

Upon creating an API with the JMS/AMQP Routing Policy, messages are successfully delivered to the destination queue during API execution. However, the endpoint API fails to return a successful response, and the message is not present in the replyTo queue. The native server issues a ‘504 Gateway Timeout’ error.

User is using RabbitMQ with the AMQP plugin rabbitmq_amqp1_0.

Server.log snippet –

[YAI.0002.9999E] (tid=343) [default][XXX][APIGW:XXX:XXX:XXX:XXX][POL:amqpRouting]O---> Exception : Unexpected error during mediation Native service provider error. Code : 504 [YAI.0101.0018I] (tid=343) [default][XXX][APIGW:XXX:XXX:XXX:XXX] Error occurred while processing the request, Error: Native service provider error. Code : 504

This is expected behavior. As per the section Step 4: Create REST API with AMQP Outbound support of Event Driven APIs with API Gateway and AMQP

“When the API is invoked from the REST client, the API Gateway will route/post the input message to a Message Queue/Topic and look for the response in the ReplyTo Queue/Topic.”

API Gateway lacks control or access to the ReplyTo queue, making it the responsibility of the Native Endpoint to populate the queue. If the message has been successfully posted, it will serve as a response to the client; otherwise, an error will be triggered. The inability of APIGW to read the message results in a timeout error.