INNER CODE UNIT · Java
get
apache/camel-quarkus · tooling/create-extension-templates/TestResource.java:55
public String get() throws Exception {
final String message = consumerTemplate.receiveBodyNoWait("[=artifactIdBase]:--fix-me--", String.class);
LOG.infof("Received from [=artifactIdBase]: %s", message);
return message;
}
@Path("/post")
@POST
@Consumes(MediaType.TEXT_PLAIN)
@Produces(MediaType.TEXT_PLAIN)
public Response post(String message) throws Exception {
LOG.infof("Sending to [=artifactIdBase]: %s", message);
final String response = producerTemplate.requestBody("[=artifactIdBase]:--fix-me--", message, String.class);
LOG.infof("Got response from [=artifactIdBase]: %s", response);
return Response
.created(new URI("https://camel.apache.org/"))
.entity(response)
.build();