registration.setId(genId);
registration.setTopic(destination);
ClientSession createSession = createSubscription(genId, registration.isDurable());
try
{
PushConsumer consumer = new PushConsumer(sessionFactory, genId, genId, registration);
try
{
consumer.start();
if (registration.isDurable() && pushStore != null)
{
pushStore.add(registration);
}
}
catch (Exception e)
{
consumer.stop();
throw new WebApplicationException(e, Response.serverError().entity("Failed to start consumer.").type("text/plain").build());
}
consumers.put(genId, consumer);
UriBuilder location = uriInfo.getAbsolutePathBuilder();