This repository was archived by the owner on Aug 13, 2020. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 33
JsonEnvelope Cookbook
Jacek Obarymski edited this page Sep 30, 2016
·
11 revisions
import static uk.gov.justice.services.messaging.DefaultJsonEnvelope.envelope;
import static uk.gov.justice.services.messaging.JsonObjectMetadata.metadataWithRandomUUID;
final UUID correlationId = randomUUID();
final UUID sessionId = randomUUID();
final UUID userId = randomUUID();
final UUID streamId = randomUUID();
final String commandName = "notification-added";
final JsonEnvelope command = envelope()
.with(metadataWithRandomUUID(commandName)
.withClientCorrelationId(correlationId.toString())
.withSessionId(sessionId.toString())
.withUserId(userId.toString())
.withStreamId(streamId))
.withPayloadOf("Example Value", "exampleField")
.build();