Custom message configuration

Open the configuration file o2server/config/messages. Json (can not exist under the config from configSample copy), O2V5. 3 after version can login in the web terminal system, Go to System Settings — Base — Configuration to find messages.json and add the configuration for custom message types (example) at the end of the document:

"custom_mq": { "consumersV2": { "ws": "", "pms": "", "zhengwuDingding": "", "qiyeweixin": "", "welink": "", "dingding": ""}}Copy the code

Custom_mq is the custom message type, and the name must start with custom_. If you want to customize sending websocket messages (consumer is WS), the name of the message type must be custom****_create. The required consumer is configured in consumersV2.

Customize message sending

The platform provides a customized message sending API. Developers call the interface to send messages according to business needs, and the interface address enters

http://ip:20020/x_message_assemble_communicate/jest/index.html, find MessageAction customCreate service, invoke the sample:

Third, message consumption query

Also enter the API service address of the second step, find the listPaging service of MessageAction, and query messages based on the conditions (the platform retains messages for 7 days by default) :