Package com.eqixiac.equinix.messaging
package com.eqixiac.equinix.messaging
Client for the Equinix Messaging Gateway (EMG), Equinix's push channel for notifications:
IBX (data center) and network maintenance and incidents (flagged
SERVICE_IMPACTING or
NON_SERVICE_IMPACTING), Fabric port/virtual-connection up/down, billing start, order status
and Managed Services tickets. EMG publishes JSON envelopes ({"Task": {...header, "Body": {...}},
"Signature": "..."}) to a queue dedicated to your organisation on Azure Service Bus, over AMQP 1.0
(AsyncAPI emgv1, production namespace equinixemg.servicebus.windows.net).
Layers
- This package is transport agnostic: immutable message records (a sealed
EmgMessagehierarchy), the tolerantEmgMessageParserand the typedEmgMessageHandler. It has no messaging-client dependency; use it with any AMQP client by passing the message body bytes to the parser. com.eqixiac.equinix.messaging.transportadds a receive/settle loop, andcom.eqixiac.equinix.messaging.transport.servicebusbinds it to Azure Service Bus. That binding needscom.azure:azure-messaging-servicebus, which the SDK declares<optional>: add it to your own build.
Connection details
Create a subscription in the Equinix Customer Portal under Developer Settings > Messaging Gateway (one active subscription per environment; your user needs the notification permissions for the relevant IBXs), choose the notification types, then open the subscription's Configuration tab and Copy YAML: it holds the queue connection string and queue name. Treat the connection string as a secret (environment variable or secret store). The legacy client-id/client-secret (client_credentials) authentication for EMG was deprecated on
2024-03-18 and is not supported here. EMG Order Management (placing orders through EMG) was
deprecated on 2024-09-30 and is not implemented; inbound Order Notifications are.
Delivery semantics
Service Bus delivers at least once. A message whose lock expires, whose handler fails, or whose settlement is lost is delivered again, so handlers must be idempotent: de-duplicate onEmgMessage.id() (unique per notification) and, for ticket
updates, order by body().sequence(). Ordering across tickets is not guaranteed.
Example
EmgMessageHandler handler = new EmgMessageHandler() {
@Override
public void onIbxNotification(IbxNotification n) {
if (n.body().isServiceImpacting()) {
alert(n.category(), n.body().servicerId(), n.body().startDateTime());
}
}
};
EmgReceiver receiver = ServiceBusEmgReceiver.forQueue(
System.getenv("EMG_CONNECTION_STRING"), System.getenv("EMG_QUEUE"));
try (EmgListener listener = new EmgListener(receiver, handler)) {
Runtime.getRuntime().addShutdownHook(new Thread(listener::close));
listener.run(); // blocks: complete on success, abandon on handler error,
} // dead-letter bodies that are not EMG envelopes
-
ClassDescriptionBilling notification: sent when an order is closed and Equinix starts billing (resellers also receive it for their customers' orders, since R2024.7).Billing notification body.One billed line.The header attributes common to every EMG notification: the
Taskattributes other thanBody, plus the envelope'sSignature.A parsed Equinix Messaging Gateway notification.Callback interface for typed EMG notifications.Parses Equinix Messaging Gateway message bodies into typedEmgMessages.Thrown byEmgMessageParserwhen input is not an EMG envelope at all: empty, not JSON, not a JSON object, or without aTaskobject.The action an EMG notification reports (Task.Verb).Equinix Fabric port or virtual-connection operational-status notification (port/VC up or down), delivered withTask.ResourceDataCenter.Network.PortorDataCenter.Network.VirtualConnection.Fabric asset type.Fabric notification body.Virtual connections on a port.The affected port or virtual connection.Embedded related resources.Operational-status details.Operational status of the port or connection.Fabric notification type.IBX (data center) maintenance, incident, security-incident or advisory notification:Task.ResourceDataCenter.Maintenance,DataCenter.Incident,DataCenter.SecurityIncidentorDataCenter.Advisory, schema version 1.0 or 2.0.Equinix Managed Services trouble-ticket or service-request notification:Task.ResourceTroubleTicket.ManagedServiceorServiceRequest.ManagedService(specManagedServicesBody).Managed Services notification body.Impact or urgency level.Ticket/request details.Network maintenance or incident notification:Task.ResourceNetwork.MaintenanceorNetwork.Incident(schema 1.0), or a ticket-shapedDataCenter.Network.Port/DataCenter.Network.VirtualConnectionnotification (the spec maps those 2.0 resources toNetworkNotificationV2Body; when their body is instead Fabric-shaped, the parser produces aFabricNotification).Order status notification for orders placed through the Customer Portal, the APIs or EMG (Cross Connect, Smart Hands, Work Visit, Shipment, Trouble Ticket, ...):Task.Resourceone of the spec's order product groups (SmartHands,Shipping,WorkVisit, ...).An order attachment.Order notification body (specOrderNotificationBody).Order state.Whether an IBX or network maintenance/incident affects the customer's services (Body.Impact; introduced in EMG release R2024.1, replacing the generic "OUTAGE" wording).Body of an IBX (data center) or network maintenance/incident notification.An affected customer asset.The kind of event an IBX or network ticket notification describes, derived from the suffix ofTask.Resource(for exampleDataCenter.MaintenanceorNetwork.Incident).Lifecycle state of an IBX or network maintenance/incident ticket (Body.State).A well-formed EMG envelope this SDK version cannot type: an unrecognisedTask.Resource, a missingBody, or a body that does not fit the model for its resource.