0% found this document useful (0 votes)
2 views7 pages

Claim Check Pattern

The document outlines the Claim Check Pattern for handling large messages in Azure Service Bus by splitting them into a claim check and a payload, with the payload stored externally to reduce costs and prevent message bus overload. It details the functionalities of the Claim Check Publisher and Subscriber APIs, including handling messages greater than 256 KB and logging message traceability. The document also includes operational responsibilities, security controls, and known issues related to the implementation of the solution.

Uploaded by

Just Chill
Copyright
© All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
2 views7 pages

Claim Check Pattern

The document outlines the Claim Check Pattern for handling large messages in Azure Service Bus by splitting them into a claim check and a payload, with the payload stored externally to reduce costs and prevent message bus overload. It details the functionalities of the Claim Check Publisher and Subscriber APIs, including handling messages greater than 256 KB and logging message traceability. The document also includes operational responsibilities, security controls, and known issues related to the implementation of the solution.

Uploaded by

Just Chill
Copyright
© All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd

Table of contents

Internal Generic Info > Documentation > Services > Integration > Azure Service Bus

Claim Check Pattern 2

Page: 1 of 7
Claim Check Pattern

Claim Check Pattern: APIM Solution


Description

Split a large message into a claim check and a payload. Send the claim check to the
messaging platform and store the payload to an external service. This pattern allows large
messages to be processed while protecting the message bus and the client from being
overwhelmed or slowed down. This pattern also helps to reduce costs, as storage is
usually cheaper than resource units used by the messaging platform.

There are mainly two APIs we have deployed, they are as follows:

Claim Check Publisher API


Claim Check Subscriber API

Claim Check : Publisher API


S ervice B us Queue mes s ag e s iz e limit : Service Bus queues support a maximum
message size of 256 KB (the header, which includes the standard and custom application
properties, can have a maximum size of 64 KB)

Paylo ad L es s er t han 256 K B :

Page: 2 of 7
W hen a message lesser than 256 KB is sent to the Azure service bus, then the message is
sent to the service bus as it is, without any intervention from the claim check publisher
API, only a flag Biggerthan256kb = "No" is appended to the message, this means that in
this case message is lesser than 256KB, and there is no need to store data in storage
account, and the data is directly accessible from the Service Bus

Paylo ad G reat er t han 256 K B :

W hen a message is greater than 256 kb, then the message is not sent to the service bus
directly, instead the payload is uploaded to a storage account and a message with the
following custom header properties is sent to the service bus

filename : name of the file that has been uploaded to the blob storage
s t o rag ename : name of the storage where the file has been uploaded
co nt ainername : name of the container where the file has been uploaded
fo ld ername : name of the folder where the file has been uploaded
B ig g ert han256kb : whether the file is bigger the 256KB ("Yes/No"), in this case
"Yes"

so later on these properties can be used to retrieve the payload from the storage
account,

the main idea behind this approach is to remove the extra overhead from the service bus,
when the message size is greater than 256KB, in this way message can be transacted in a
more efficient manner.

No t e: Kindly note that 256 KB is inclusive of Message Properties. In order to make it


working, make sure Message Propeties won’t cross its limit of 10 KB in size.

parameters:

To p ic: Name of the Topic

Headers:

ocp-apim -subscription-key: subscription key for the Api

Claim Check: Subscriber Api


The subscriber API is used to fetch the payload data from the storage account, once we
pass the needful parameters to the API the, the API fetches the payload data from the
storage account which has been uploaded by the publisher API for being more than 256kb.

Paramet ers :

Page: 3 of 7
service-bus-nam espace : name of the service bus namespace
where the payload was sent by publisher.
topic-nam e: name of the topic where payload was sent by
publisher.
subscription-nam e : name of the subscription through which
consumer application is connected to topic.
m ode: name of mode for receiving of payload. (possible values
are Peek , R eceive )

Head ers :

ocp-apim -subscription-key: subscription key for the Api

Out p ut : the content of the payload is retrieved in JSON format

Claim Check: Send Message Trace Log


The Send Message Trace Log operation adds traceability for messages by
logging details to blob storage irrespective of payload size. It enriches
messages with metadata properties for ef cient management and debugging.

Operation Name

Send Message Trace Log

Functionality

Always pushes a copy of the message payload to blob storage.


Adds the following metadata under message properties:
containername: Name of the container in blob storage.
storagename: Name of the storage account.
lename: Name of the le containing the message in blob
storage.

Query Parameters

service-bus-namespace (required): The Service Bus namespace to log


the message trace.
topic-name (required): The name of the topic for which the message
trace is logged.
message-preview-size (optional): Default is 0 (in KB). Determines the
size of the message preview included in the Service Bus topic payload.

Page: 4 of 7
Purpose
This operation enhances traceability and troubleshooting for messages in the
Service Bus by maintaining a persistent log of message metadata and payloads
in blob storage.

Vers io n His t o ry

Updated Approval Approval


Version Date Description
by Architect Security

Arijit Henning
1.0 2/20/24 Reference Document
Brahma Pedersen

Anubhav Send Message Henning


2.0 11/20/24
Tiwari Trace Log added Pedersen

Reference Documents

Doc. Type Description Location

Architecture Reference Architecture Document Claim [Link]

Relevant Stakeholders

Stakeholder type / Role Organisation Name Contact info

Solution Architect Solutions Henning Pedersen hp@[Link]

Document Purpose
The purpose of this document is to perform a full presentation of the solution. The
document describes the Solution functionality, design decisions and important
configuration/programming settings, including references to decisions, deployment,
configuration, design, development or coding documentation, which is needed when rolling
out the solution.

Executive Summary

Page: 5 of 7
Split a large message into a claim check and a payload. Send the claim check to the
messaging platform and store the payload to an external service. This pattern allows large
messages to be processed while protecting the message bus and the client from being
overwhelmed or slowed down. This pattern also helps to reduce costs, as storage is
usually cheaper than resource units used by the messaging platform.

Operational Responsibilities
IBM API team

Security Control:
The API call is secured by the subscription key which needs to be passed in the header in
the below format for both the subscriber and the publisher Api

ocp-apim -subscription-key: subscription key for the Api

Azure Resources :
APIM: the policies are set in the APIM
Storage Account: for storing the payloads greater than 256KB
Azure Service Bus: for messaging service

Architecture :
Publisher Api :

Page: 6 of 7
S ub s crib er A PI:

Monitoring and Logging


all the API transaction details are logged in to the Azure App insight.

Known Issues, Problems or limitations


W rong service-bus-namespace: error 404 resource not found or does not exist
W rong topic-name: error 404 resource not found or does not exist
W rong subscription-name: error 404 resource not found or does not
exist
W rong mode: error 500 internal server error.

Powered by Document360

Page: 7 of 7

You might also like