Function: Debugging Received AMQP Messages

by Simon Sparks · 5 September 2025

To use this function add it to the class library file named vCloudService.ts

GitHub Repository: https://github.com/SimonSparksUK/Orchestrator

Filename: vCloudService.ts

Description: Orchestrator Function to debug logging of received AMQP Message

Function AMQPSubscriptionMessageLog

public AMQPSubscriptionMessageLog(objAMQPSubscription:AMQPSubscription): void {
    let objProperties:Properties = objAMQPSubscription.retrieveLastOnMessageTrigger();

    let strMessageBody:string = objProperties.get('body');

    this.objLogger.info("Message Body: " + strMessageBody);

    let objHeaders: Properties = objProperties.get('headers');

    this.objLogger.info("notification.type : " + objHeaders.get("notification.type"));
    this.objLogger.info("notification.orgUUID : " + objHeaders.get("notification.orgUUID"));
    this.objLogger.info("notification.entityType : " + objHeaders.get("notification.entityType"));
    this.objLogger.info("notification.entityUUID : " + objHeaders.get("notification.entityUUID"));
    this.objLogger.info("notification.userUUID : " + objHeaders.get("notification.userUUID"));
    this.objLogger.info("notification.operationSuccess : " + objHeaders.get("notification.operationSuccess"));

    let objProperties2: Properties = objProperties.get('properties');

    this.objLogger.info("receivedRoutingKey : " + objProperties2.get("receivedRoutingKey"));
    this.objLogger.info("messageCount : " + objProperties2.get("messageCount"));
    this.objLogger.info("deliveryMode : " + objProperties2.get("deliveryMode"));
    this.objLogger.info("priority : " + objProperties2.get("priority"));
    this.objLogger.info("deliveryTag : " + objProperties2.get("deliveryTag"));
    this.objLogger.info("contentType : " + objProperties2.get("contentType"));
    this.objLogger.info("contentEncoding : " + objProperties2.get("contentEncoding"));
    this.objLogger.info("receivedExchange : " + objProperties2.get("receivedExchange"));
    this.objLogger.info("contentLength : " + objProperties2.get("contentLength"));
}

Discover more from Cloud Build Tools

Subscribe to get the latest posts sent to your email.

You may also like