Data transmission from Loymax System to Smart Communications via RabbitMQ


The Loymax System allows exchanging event results with Smart Communications. This allows real-time updates on events in Smart Communications. Events are transmitted via the message broker RabbitMQ.

Data transmission process from the Loymax System to Smart Communications via RabbitMQ

Let’s use the Customer registration event as an example.

Input parameters:

  • Customer registration, which includes events such as Registration started, Registration completed, New card linked to LP Member, etc. (marked as line A in the diagram).
  • Other events (marked as line B in the diagram) unrelated to customer registration—for example, target audience calculation, offer edits, etc.

All events occurring in the system are sent to an Exchange. The exchange routes events (Routing) into one or more queues depending on the event type. Events related to Customer registration, in addition to their designated queues, are also routed to a dedicated queue linked to Smart Communications. The Smart Communications platform retrieves events from this queue in real time. All other events are routed only to their respective queues.

To transmit events to the Smart Communications platform, the Loymax.Plugins.SmartCommunications plugin must be connected. Enabling the plugin creates a dedicated queue linked to Smart Communications, and event messages are placed in that queue.

Protocols of event transmission via RabbitMQ

Smart Communications receives information via RabbitMQ about the following events related to a Loyalty Program (LP) Member’s activity:

  • Events related to LP Member registration:
    • LP registration started;
    • LP registration completed;
    • Card linked to LP Member;
    • LP Member profiles merge (consolidation under one account);
    • Card activation.
  • Card blocking/unblocking;
  • Card deletion/restoration;
  • Card category change;
  • LP Member attribute updates;
  • Subscription status changes;
  • Events related to LP Member's purchases:
    • Purchase;
    • Purchase refund.

Events are sent to the smc.customerEvents queue. Detailed information about all events is provided in the table below.

EventDescriptionRouting keysExample model sent to the queue
Registration startedThe event is enqueued when a customer begins the LP registration process.customer.registration.begin
Registration completedThe event is enqueued when a customer successfully completes registration.customer.registration.finish

Card linking includes three events:

  • Card replacement (ReplaceCard);
  • Merging cards under one account (AttachCard);
  • Attaching a new card (SetCard).

The linking method is passed in the linkCardType parameter.

For card replacement, new card details are provided in the newCard parameter, and the replaced card’s information is in oldCard.

In all other cases, oldCard is set to null.

customer.card.link
Merge under one accountThe event is enqueued when one LP Member’s account is merged with another’s.customer.profile.merge
Card activationThe event is enqueued when a card transitions from the Issued or Activating state to Activated.customer.card.changeState

Events are enqueued when an LP Member’s card status changes between blocked and unblocked.

For blocking, the request includes the parameter targetBlockState set to true.

For unblocking, targetBlockState is set to false.

customer.card.changeBlockState
Card deletion/restoration

Events are enqueued upon deletion or restoration of a card.

For deletion, the request includes the parameter targetDeleteState set to true.

For restoration, targetDeleteState is set to false.

customer.card.changeDeleteState
Card category changeThe event is enqueued when an LP Member’s card category changes—for example, when the customer’s LP status is upgraded.сustomer.card.changeCategory
LP Member attribute update

The event is enqueued when LP Member attributes are updated. These include:

  • Public Offer acceptance;
  • Phone number confirmation;
  • Completion of application form, etc.
customer.attribute.update
Subscription status changeThe event is enqueued when an LP Member’s subscription status changes.customer.subscription.update
The event is enqueued when an LP Member makes a purchase.purchases.confirm.modelUpdate
The event is enqueued when an LP Member refunds a purchase.purchases.refundModelUpdate