SWIFT Module 7.1 SP13.June 2023 | Getting Started | Concepts | SWIFTNet Component | SWIFTNet Component Store-and-Forward Mode | Retrieving Messages and Files from a Queue
 
Retrieving Messages and Files from a Queue
Messages and files can be retrieved from a queue using pull or push modes.
Pull Mode
When the pull mode is used, the client process initiates the delivery of a message. It performs an SwCall() with Sw:PullSnFRequest as the input primitive. The Sw:PullSnFResponse contains the message pulled from the queue.
The following diagram illustrates the store-and-forward InterAct pull session. See the table below the diagram for additional information.
Step
Description
1
The client sends the Sw:InitRequest to start delivering messages and files in a SnF queue. Next, the client uses SwSec:CreateContextRequest to open the desired security context.
2
The client sends a request to acquire the queue. After receiving the response, the client starts delivering messages by issuing the Sw:PullSnFRequest.
3
The first Sw:PullSnFRequest does not carry an acknowledgment, but all subsequent requests must acknowledge the message delivered in the previous pull request to avoid the same message being delivered again.
4
Messages are removed from the queue.
5
When the client is finished delivering messages, the client sends Sw:AckSnFRequest (Sw:ExchangeSnFRequest) along with the acknowledgment of the last delivered message as input primitive.
6
The client destroys the created security context and triggers the termination with the SNL.
Push Mode
When push mode is used, the initiative to deliver a message resides with SWIFTNet SnF. The message is pushed from SWIFTNet SnF and is received by the server on SWIFTNet Link. In this server, a regular SwCallback() is invoked. The input primitive is the message from the queue within a SwInt:HandleRequest or Sw:HandleFileRequest. The server application ensures that the message is stored safely, and then responds with an acknowledgment to SWIFTNet SnF indicating how the message was received.
The following diagram illustrates the store-and-forward InterAct Push session. See the table below the diagram for additional information.
Step
Description
1
The server process opens the required security context with Sw:HandleInitRequest and SwSec:CreateContextRequest. The server prepares to process the incoming requests.
2
The client process starts, sends the Sw:InitRequest, opens the desired security context, acquires the queue in pull mode, and starts delivering messages.
3
The server receives a SwInt:HandleRequest request.
4
The server sends an acknowledgment in SwInt:HandleResponse.
5
Messages are removed from the queue.
6
The client releases the queue.