@Override public void storePayload(StoreRequest request) throws TopicNotFoundException, IOException { getMessagingService().storePayload(request); }
@Override public void storePayload(StoreRequest request) throws TopicNotFoundException, IOException { getMessagingService().storePayload(request); }
@POST @Path("/store") public void store(FullHttpRequest request, HttpResponder responder, @PathParam("namespace") String namespace, @PathParam("topic") String topic) throws Exception { TopicId topicId = new NamespaceId(namespace).topic(topic); StoreRequest storeRequest = createStoreRequest(topicId, request); // It must be transactional with payload for store request if (!storeRequest.isTransactional() || !storeRequest.hasPayload()) { throw new BadRequestException("Store request must be transactional with payload. Topic: " + topicId); } messagingService.storePayload(storeRequest); responder.sendStatus(HttpResponseStatus.OK); }
@POST @Path("/store") public void store(FullHttpRequest request, HttpResponder responder, @PathParam("namespace") String namespace, @PathParam("topic") String topic) throws Exception { TopicId topicId = new NamespaceId(namespace).topic(topic); StoreRequest storeRequest = createStoreRequest(topicId, request); // It must be transactional with payload for store request if (!storeRequest.isTransactional() || !storeRequest.hasPayload()) { throw new BadRequestException("Store request must be transactional with payload. Topic: " + topicId); } messagingService.storePayload(storeRequest); responder.sendStatus(HttpResponseStatus.OK); }
client.storePayload(StoreRequestBuilder.of(topicId).setTransaction(1L).build()); Assert.fail("Expected IllegalArgumentException"); } catch (IllegalArgumentException e) { client.storePayload(StoreRequestBuilder.of(topicId) .addPayload(payload).addPayload(payload).setTransaction(1L).build()); client.storePayload(StoreRequestBuilder.of(topicId) .addPayload(payload).addPayload(payload).setTransaction(2L).build()); client.publish(StoreRequestBuilder.of(topicId).setTransaction(2L).build());