Skip to content

Message-Driven Bean implementation for TelegramAlertingJob in SAP PI/PO

Notifications You must be signed in to change notification settings

sanberg/AlertsTelegram4SAPPO

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

9 Commits
 
 
 
 
 
 
 
 

Repository files navigation

AlertsTelegram4SAPPO

Message-Driven Bean implementation class for TelegramAlertingJob in SAP PI/PO. Sends messages from standard JMS queue alertingVP to Telegram channel via bot.

Telegram bot & channel settings

  1. Create public channel with public link (@nickname)
  2. Create bot via @botfather
  3. Add bot to channel as admin

How to config job in SAP PO

  1. Operations->Jobs and open Java Scheduler

Java Scheduler

  1. On Java Scheduler screen go to tab Tasks and click the Add button

Tasks

  1. Select TelegramAlertingJob

image

  1. Enter Job Parametres

image

alertConsumer: name of a consumer that was set in SAP PO Alert Rule. This is used as a name for JMS queue in alertingVP.

maxAlertCount is max count of consumed alerts from JMS queue

apiToken: can be retrieved from BotFather;

chatId: id of telegram channel (described below in How to get id of private telegram channel)

  1. Do not forget to set back channel as private one unless you want everyone to see a mess in your system ^^
  2. Set timer parameters. Running job every 2 min would be enough and much more representative than emails.

image

  1. Finish the job configuration. As a result you will find a job on Tasks tab

image

How to get id of private telegram channel

As a result you will get JSON including real chat id:

{
    "ok": true,
    "result": {
        "chat": {
            "id": -100187777,
            "title": "SAP PO Critical Alerts",
            "type": "channel",
            "username": "nickname"
        },
        "date": 1667811418,
        "entities": [
            {
                "length": 4,
                "offset": 0,
                "type": "bold"
            }
        ],
        "message_id": 4,
        "sender_chat": {
            "id": -100187777,
            "title": "SAP PO Critical Alerts",
            "type": "channel",
            "username": "nickname"
        },
        "text": "test"
    }
}

About

Message-Driven Bean implementation for TelegramAlertingJob in SAP PI/PO

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages