Skip to main content
SmartLogix includes an event-driven notification system and a standalone notification service. When a new order is created, the order service (ms-pedidos) publishes a PedidoAprobadoEvent using Spring’s ApplicationEvent mechanism. An internal listener handles this event asynchronously and logs the notification. The separate notification-service on port 8085 is an independent REST receiver that your own systems — fulfillment tools, email providers, dashboards — can call or integrate with directly.

When the internal event fires

The PedidoAprobadoEvent is published immediately after a new order is saved, while its status is still PENDIENTE. The internal NotificationListener in ms-pedidos logs the event payload asynchronously. No HTTP call to the notification-service is made automatically — that integration is left for production configuration.

Notification payload

The notification is delivered as a JSON POST to the notification service. The payload contains the key details of the approved order:
{
  "pedidoId": 42,
  "userEmail": "user@example.com",
  "total": 299.90,
  "tipoPedido": "NACIONAL"
}
FieldTypeDescription
pedidoIdintegerID of the approved order
userEmailstringEmail of the user who placed the order
totalnumberOrder total value
tipoPedidostringNACIONAL or INTERNACIONAL

Using the notification service

The notification service exposes a POST /notificaciones endpoint that accepts any JSON payload. You can send payloads to it directly from your own systems or scripts. The service logs every received payload and returns a confirmation:
curl -X POST http://localhost:8085/notificaciones \
  -H "Content-Type: application/json" \
  -d '{
    "pedidoId": 42,
    "userEmail": "user@example.com",
    "total": 299.90,
    "tipoPedido": "NACIONAL"
  }'
A successful request returns 200 OK with the body Notificación procesada.
The notification service runs on port 8085 directly. It is not behind the API gateway at port 8080, so calls go to http://localhost:8085/notificaciones. No JWT token is required.

Health check

Verify the notification service is running before using it:
curl http://localhost:8085/notificaciones/health
Returns notification-service UP when healthy.

Integration notes

The notification service does not validate the shape of the JSON payload — it accepts any Map<String, Object>. To connect it to order events in production, configure the NotificationListener in ms-pedidos to send an HTTP POST to http://notification-service:8085/notificaciones with the PedidoAprobadoEvent payload after saving each order.

Endpoint reference

MethodPathAuth requiredDescription
POST/notificacionesNoReceive an order approval notification
GET/notificaciones/healthNoCheck notification service health