public class ZKDeploymentMessagePublisher extends java.lang.Object implements DeploymentMessagePublisher
DeploymentMessagePublisher that publishes
deployment messages into a ZooKeeper/Curator
distributed queue.
The implementation of poll(org.springframework.xd.dirt.server.admin.deployment.DeploymentMessage) blocks the executing thread until
the message has been processed by the recipient. This is done by
writing the DeploymentMessage.requestId to ZooKeeper and
placing a watch on the children of the node to expect a response
by the message handler.
| Modifier and Type | Field and Description |
|---|---|
static java.lang.String |
ERROR
Name of ZooKeeper node that indicates the deployment message
encountered an error during processing.
|
static java.lang.String |
SUCCESS
Name of ZooKeeper node that indicates the deployment message
was succesfully processed.
|
| Constructor and Description |
|---|
ZKDeploymentMessagePublisher(DeploymentQueue deploymentQueue)
Construct the deployment message producer.
|
| Modifier and Type | Method and Description |
|---|---|
void |
poll(DeploymentMessage message)
Publish the
DeploymentMessage and block the
executing thread until the message has been processed
by the recipient. |
void |
publish(DeploymentMessage message)
Publish the
DeploymentMessage and immediately
return. |
public static final java.lang.String SUCCESS
public static final java.lang.String ERROR
public ZKDeploymentMessagePublisher(DeploymentQueue deploymentQueue)
deploymentQueue - the deployment queuepublic void publish(DeploymentMessage message)
DeploymentMessagePublisherDeploymentMessage and immediately
return.publish in interface DeploymentMessagePublishermessage - the deployment messagepublic void poll(DeploymentMessage message)
DeploymentMessagePublisherDeploymentMessage and block the
executing thread until the message has been processed
by the recipient.poll in interface DeploymentMessagePublishermessage - the deployment message