SaFi Bank Space : [WIP] Integrate Meiro with output-manager

There are two ways to integrate Meiro with output-manager.

  • RESTful API

There are two endpoints exposed by output-manager.

POST /meiro/broadcast.

This endpoint broadcasts the same message to a list of selected customers. And the allowed maximum number of customerID’s of this endpoint is 100,000

POST /meiro/send

This endpoint sends customer-specific messages to different customers. For example, you may want to send a Happy Birthday message to customerA, and a product promotion message to customerB at the same time, you can use this endpoint to do so. The allowed maximum number of messages is 1000.

You can call these endpoints with your own HTTP client; or you can use our Java SDK to do so. Our maven repository is https://console.cloud.google.com/artifacts/maven/safi-repos/asia-southeast1/safi-maven, and if you have access to it, please add the following dependency to your gradle/maven file.

implementation(“ph.safibank.outputmanager.client:output-manager-api-client:11“)

then, you should set the environment variable SAFI_OUTPUT_MANAGER_URL to point to the base URL of output-manager service. Here is an example.

@Inject
private OutputManagerWrapper client;

// other logics

public void demoFunction() {
  ArrayList<MeiroMessage> messages = new ArrayList<MeiroMessage>();
  MeiroMessage message1 = new MeiroMessage();
  message1.channel = DeliveryChannel.SMS;
  message1.customerId = "ID of customerA";
  message1.title = "Happy Birthday";
  message1.text = "Dear Mr. xxx, tomorrow is your birthday. Happy Birthday on

  MeiroMessage message2 = new MeiroMessage();
  message2.channel = DeliveryChannel.VIBER;
  message2.customerId = "ID of customerB";
  message2.title = "Wanna explore the possibilities to earn money with SaFi?";
  message2.text = "Hi Miss XXX, as a fashionlady, we know you wanna be differe....";
  
  messages.add(message1);
  messages.add(message2);
  try {
      client.meiroApi.sendMeiroMessages(MeiroRequestDto(messages));
  } catch (ApiException e) {
      logger.error("failed to send messages out", e)
  }
}
  • Kafka Topics

  1. Access to Confluent Kafka Cluster

Please use the following settings to access Confluent Kafka cluster.

confluent-idp-id: pool-pGM7
okta_client_id:   0oa3gxpp5rIdCOqIs697
okta_client_secret: 1tnVHzls0lGwTM0EXvqulOvPJfUCNMV9Jk82fJqA
okta_custom_scope:  confluent
okta_oauth_token_url: https://safibank.okta.com/oauth2/default/v1/token

2. Avro Schema

3, Kafka Topic Name

commons.meiro-send-customer-message.command.v1

Attachments:

image-20221206-101301.png (image/png)
image-20221206-101415.png (image/png)
MeiroSendMessageCommandV1.avsc (application/octet-stream)