Backend/Microservices/PaymentService/server/src/Helpers/sqsHelper.js
/**
    * Method to send message to the Initialized queue.
    * @param messageBody: The JSON object that needs to be send.
    * @param deduplicationId: The message deduplication id.
    * @param groupId: The message Group Id.
    * @returns {Promise<boolean>}:true,  if send successfully, else false.
    */
Method to send message to the Initialized queue.
@param messageBody: The JSON object that needs to be send.
@param deduplicationId: The message deduplication id.
@param groupId: The message Group Id.
@returns {Promise}:true,  if send successfully, else false.
Method to send message to the Initialized queue . @param messageBody : The JSON object that needs to be send . @param deduplicationId : The message deduplication id . @param groupId : The message Group Id . @returns { Promise } : true if send successfully else false .
sendMessage(messageBody, deduplicationId, groupId) {
      return new Promise((resolve, reject) => {
         const sendParams = {};
         sendParams[constants.SQS_MESSAGE_BODY] = JSON.stringify(messageBody);
         sendParams[constants.SQS_QUEUE_URL] = this._queueUrl;
         sendParams[constants.SQS_MESSAGE_GROUP_ID] = groupId;
         sendParams[constants.SQS_DEDUPLICATION_ID] = deduplicationId;
         awsHelper.sqs.sendMessage(sendParams, (err, data) => {
            if (err) {
               printer.printError(err);
               reject(false);
            } else {
               printer.printLog(data);
               resolve(true);
            }
         });
      });
   }
sendMessage ( messageBody , deduplicationId , groupId ) { return new Promise ( ( resolve , reject ) => { const sendParams = { } ; sendParams [ constants . SQS_MESSAGE_BODY ] = JSON . stringify ( messageBody ) ; sendParams [ constants . SQS_QUEUE_URL ] = this . _queueUrl ; sendParams [ constants . SQS_MESSAGE_GROUP_ID ] = groupId ; sendParams [ constants . SQS_DEDUPLICATION_ID ] = deduplicationId ; awsHelper . sqs . sendMessage ( sendParams , ( err , data ) => { if ( err ) { printer . printError ( err ) ; reject ( false ) ; } else { printer . printLog ( data ) ; resolve ( true ) ; } } ) ; } ) ; }
Method to send message to the Initialized queue.
Method to send message to the Initialized queue .