Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
import io.swagger.v3.oas.annotations.Parameter;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.http.MediaType;
import org.springframework.http.ResponseEntity;
import org.springframework.web.bind.annotation.*;
import org.springframework.beans.factory.annotation.Autowired;
Expand Down Expand Up @@ -140,7 +141,10 @@ public ResponseEntity<String> stopBroker(@PathVariable Long id, @RequestParam St
* @param brokerType, the type of broker: classic or artemis
* @return list of connections with status 200 (OK) or with status 404 (Not Found)
*/
@GetMapping(path = "/brokers/{brokerType}/connections", produces = {"text/plain","application/xml","application/json"})
@GetMapping(
path = "/brokers/{brokerType}/connections",
produces = {MediaType.APPLICATION_JSON_VALUE, MediaType.APPLICATION_XML_VALUE, MediaType.TEXT_PLAIN_VALUE}
)
public ResponseEntity<String> getConnections(@Parameter(hidden = true) @RequestHeader("Accept") String mediaType, @PathVariable String brokerType) throws Exception {

log.debug("REST request to get get connections");
Expand All @@ -161,7 +165,10 @@ public ResponseEntity<String> getConnections(@Parameter(hidden = true) @RequestH
* @param brokerType, the type of broker: classic or artemis
* @return list of consumers with status 200 (OK) or with status 404 (Not Found)
*/
@GetMapping(path = "/brokers/{brokerType}/consumers", produces = {"text/plain","application/xml","application/json"})
@GetMapping(
path = "/brokers/{brokerType}/consumers",
produces = {MediaType.APPLICATION_JSON_VALUE, MediaType.APPLICATION_XML_VALUE, MediaType.TEXT_PLAIN_VALUE}
)
public ResponseEntity<String> getConsumers(@Parameter(hidden = true) @RequestHeader("Accept") String mediaType, @PathVariable String brokerType) throws Exception {

log.debug("REST request to get get consumers");
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.http.MediaType;
import org.springframework.http.ResponseEntity;
import org.springframework.web.bind.annotation.*;

Expand Down Expand Up @@ -35,7 +36,10 @@ public class MessageBrokerRuntime {
* @param filter, the filter
* @return list of messages with status 200 (OK) or with status 404 (Not Found)
*/
@GetMapping(path = "/brokers/{brokerType}/messages/{stepName}/{filter}", produces = {"text/plain","application/xml","application/json"})
@GetMapping(
path = "/brokers/{brokerType}/messages/{stepName}/{filter}",
produces = {MediaType.APPLICATION_JSON_VALUE, MediaType.APPLICATION_XML_VALUE, MediaType.TEXT_PLAIN_VALUE}
)
public Object listMessages(@Parameter(hidden = true) @RequestHeader("Accept") String mediaType, @PathVariable String brokerType, @PathVariable String stepName, @RequestParam(value = "filter", required = false) String filter) throws Exception {

log.debug("REST request to list messages for queue : {}", stepName);
Expand All @@ -58,7 +62,10 @@ public Object listMessages(@Parameter(hidden = true) @RequestHeader("Accept") St
* @param stepName, the name of the queue
* @return list of messages with status 200 (OK) or with status 404 (Not Found)
*/
@GetMapping(path = "/brokers/{brokerType}/messages/{stepName}/count", produces = {"text/plain","application/xml","application/json"})
@GetMapping(
path = "/brokers/{brokerType}/messages/{stepName}/count",
produces = {MediaType.APPLICATION_JSON_VALUE, MediaType.APPLICATION_XML_VALUE, MediaType.TEXT_PLAIN_VALUE}
)
public Object countMessages(@Parameter(hidden = true) @RequestHeader("Accept") String mediaType, @PathVariable String brokerType, @PathVariable String stepName) throws Exception {

log.debug("REST request to list messages for queue : {}", stepName);
Expand All @@ -82,7 +89,10 @@ public Object countMessages(@Parameter(hidden = true) @RequestHeader("Accept") S
* @param messageId, the messageId (retrieved to listMessages)
* @return The message (body and headers) with status 200 (OK) or with status 404 (Not Found)
*/
@GetMapping(path = "/brokers/{brokerType}/message/{stepName}/browse/{messageId}", produces = {"text/plain","application/xml","application/json"})
@GetMapping(
path = "/brokers/{brokerType}/message/{stepName}/browse/{messageId}",
produces = {MediaType.APPLICATION_JSON_VALUE, MediaType.APPLICATION_XML_VALUE, MediaType.TEXT_PLAIN_VALUE}
)
public Object browseMessage(@Parameter(hidden = true) @RequestHeader("Accept") String mediaType, @PathVariable String brokerType, @PathVariable String stepName, @PathVariable String messageId, @RequestParam(value = "excludeBody", required = false) boolean excludeBody) throws Exception {

log.debug("REST request to browse message on: {}", stepName);
Expand All @@ -105,7 +115,10 @@ public Object browseMessage(@Parameter(hidden = true) @RequestHeader("Accept") S
* @param stepName, the name of the queue
* @return list of messages (body or headers) with status 200 (OK) or with status 404 (Not Found)
*/
@GetMapping(path = "/brokers/{brokerType}/messages/{stepName}/browse", produces = {"text/plain","application/xml","application/json"})
@GetMapping(
path = "/brokers/{brokerType}/messages/{stepName}/browse",
produces = {MediaType.APPLICATION_JSON_VALUE, MediaType.APPLICATION_XML_VALUE, MediaType.TEXT_PLAIN_VALUE}
)
public Object browseMessages(@Parameter(hidden = true) @RequestHeader("Accept") String mediaType, @PathVariable String brokerType, @PathVariable String stepName, @RequestParam(value = "page", required = false) Integer page, @RequestParam(value = "numberOfMessages", required = false) Integer numberOfMessages, @RequestParam(value = "excludeBody", required = false) boolean excludeBody) throws Exception {

log.debug("REST request to browse messages on: {}", stepName);
Expand All @@ -129,7 +142,11 @@ public Object browseMessages(@Parameter(hidden = true) @RequestHeader("Accept")
* @param messageHeaders, the message headers (json map)
* @return the status (success) with status 200 (OK) or with status 404 (Not Found)
*/
@PostMapping(path = "/brokers/{brokerType}/message/{stepName}/send", consumes = {"text/plain","application/xml","application/json"}, produces = {"text/plain","application/xml","application/json"})
@PostMapping(
path = "/brokers/{brokerType}/message/{stepName}/send",
consumes = {MediaType.APPLICATION_JSON_VALUE, MediaType.APPLICATION_XML_VALUE, MediaType.TEXT_PLAIN_VALUE},
produces = {MediaType.APPLICATION_JSON_VALUE, MediaType.APPLICATION_XML_VALUE, MediaType.TEXT_PLAIN_VALUE}
)
public Object sendMessage(@Parameter(hidden = true) @RequestHeader("Accept") String mediaType, @PathVariable String brokerType, @PathVariable String stepName, @RequestParam(value = "messageHeaders", required = false) String messageHeaders, @RequestBody String messageBody) throws Exception {

log.debug("REST request to send messages from queue : " + stepName);
Expand Down Expand Up @@ -157,7 +174,10 @@ public Object sendMessage(@Parameter(hidden = true) @RequestHeader("Accept") Str
* @param stepName, the name of the queue or topic
* @return the status (success) with status 200 (OK) or with status 404 (Not Found)
*/
@DeleteMapping(path = "/brokers/{brokerType}/message/{stepName}/{messageId}", produces = {"text/plain","application/xml","application/json"})
@DeleteMapping(
path = "/brokers/{brokerType}/message/{stepName}/{messageId}",
produces = {MediaType.APPLICATION_JSON_VALUE, MediaType.APPLICATION_XML_VALUE, MediaType.TEXT_PLAIN_VALUE}
)
public ResponseEntity<String> removeMessage(@Parameter(hidden = true) @RequestHeader("Accept") String mediaType, @PathVariable String brokerType, @PathVariable String stepName, @PathVariable String messageId) throws Exception {

log.debug("REST request to remove messages for queue : {}", stepName);
Expand All @@ -179,7 +199,10 @@ public ResponseEntity<String> removeMessage(@Parameter(hidden = true) @RequestHe
* @param stepName, the name of the step (topic or queue)
* @return the status (success) with status 200 (OK) or with status 404 (Not Found)
*/
@DeleteMapping(path = "/brokers/{brokerType}/messages/{stepName}", produces = {"text/plain","application/xml","application/json"})
@DeleteMapping(
path = "/brokers/{brokerType}/messages/{stepName}",
produces = {MediaType.APPLICATION_JSON_VALUE, MediaType.APPLICATION_XML_VALUE, MediaType.TEXT_PLAIN_VALUE}
)
public Object removeMessages(@Parameter(hidden = true) @RequestHeader("Accept") String mediaType, @PathVariable String brokerType, @PathVariable String stepName) throws Exception {

log.debug("REST request to remove messages for step : {}", stepName);
Expand All @@ -202,7 +225,10 @@ public Object removeMessages(@Parameter(hidden = true) @RequestHeader("Accept")
* @param targetQueueName, the name of the target queue
* @return the status (source) with status 200 (OK) or with status 404 (Not Found)
*/
@PostMapping(path = "/brokers/{brokerType}/message/{sourceQueueName}/{targetQueueName}/{messageId}", produces = {"text/plain","application/xml","application/json"})
@PostMapping(
path = "/brokers/{brokerType}/message/{sourceQueueName}/{targetQueueName}/{messageId}",
produces = {MediaType.APPLICATION_JSON_VALUE, MediaType.APPLICATION_XML_VALUE, MediaType.TEXT_PLAIN_VALUE}
)
public Object moveMessage(@Parameter(hidden = true) @RequestHeader("Accept") String mediaType, @PathVariable String brokerType, @PathVariable String sourceQueueName, @PathVariable String targetQueueName, @PathVariable String messageId) throws Exception {

log.debug("REST request to move messages from queue : " + sourceQueueName + " to " + targetQueueName);
Expand All @@ -226,7 +252,10 @@ public Object moveMessage(@Parameter(hidden = true) @RequestHeader("Accept") Str
* @param targetQueueName, the name of the target queue
* @return the status (success) with status 200 (OK) or with status 404 (Not Found)
*/
@PostMapping(path = "/brokers/{brokerType}/messages/{sourceQueueName}/{targetQueueName}", produces = {"text/plain","application/xml","application/json"})
@PostMapping(
path = "/brokers/{brokerType}/messages/{sourceQueueName}/{targetQueueName}",
produces = {MediaType.APPLICATION_JSON_VALUE, MediaType.APPLICATION_XML_VALUE, MediaType.TEXT_PLAIN_VALUE}
)
public Object moveMessages(@Parameter(hidden = true) @RequestHeader("Accept") String mediaType, @PathVariable String brokerType, @PathVariable String sourceQueueName, @PathVariable String targetQueueName) throws Exception {

log.debug("REST request to move messages from queue : " + sourceQueueName + " to " + targetQueueName);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.http.MediaType;
import org.springframework.http.ResponseEntity;
import org.springframework.web.bind.annotation.*;

Expand All @@ -30,7 +31,10 @@ public class QueueManagerRuntime {
* @param queueName, the name of the queue
* @return the status (success or failed) with status 200 (OK) or with status 404 (Not Found)
*/
@PostMapping(path = "/brokers/{brokerType}/queue/{queueName}", produces = {"text/plain","application/xml","application/json"})
@PostMapping(
path = "/brokers/{brokerType}/queue/{queueName}",
produces = {MediaType.APPLICATION_JSON_VALUE, MediaType.APPLICATION_XML_VALUE, MediaType.TEXT_PLAIN_VALUE}
)
public ResponseEntity<String> createQueue(@Parameter(hidden = true) @RequestHeader("Accept") String mediaType, @PathVariable String brokerType, @PathVariable String queueName) throws Exception {

log.debug("REST request to create queue : {}", queueName);
Expand All @@ -52,7 +56,10 @@ public ResponseEntity<String> createQueue(@Parameter(hidden = true) @RequestHead
* @param queueName, the name of the queue
* @return the status (success) with status 200 (OK) or with status 404 (Not Found)
*/
@DeleteMapping(path = "/brokers/{brokerType}/queue/{queueName}", produces = {"text/plain","application/xml","application/json"})
@DeleteMapping(
path = "/brokers/{brokerType}/queue/{queueName}",
produces = {MediaType.APPLICATION_JSON_VALUE, MediaType.APPLICATION_XML_VALUE, MediaType.TEXT_PLAIN_VALUE}
)
public ResponseEntity<String> deleteQueue(@Parameter(hidden = true) @RequestHeader("Accept") String mediaType, @PathVariable String brokerType, @PathVariable String queueName) throws Exception {

log.debug("REST request to get delete queue : {}", queueName);
Expand All @@ -74,7 +81,10 @@ public ResponseEntity<String> deleteQueue(@Parameter(hidden = true) @RequestHead
* @param queueName, the name of the queue
* @return Queue destination details
*/
@GetMapping(path = "/brokers/{brokerType}/queue/{queueName}", produces = {"text/plain","application/xml","application/json"})
@GetMapping(
path = "/brokers/{brokerType}/queue/{queueName}",
produces = {MediaType.APPLICATION_JSON_VALUE, MediaType.APPLICATION_XML_VALUE, MediaType.TEXT_PLAIN_VALUE}
)
public ResponseEntity<String> getQueue(@Parameter(hidden = true) @RequestHeader("Accept") String mediaType, @PathVariable String brokerType, @PathVariable String queueName) throws Exception {

log.debug("REST request to get get queue information : {}", queueName);
Expand All @@ -96,7 +106,10 @@ public ResponseEntity<String> getQueue(@Parameter(hidden = true) @RequestHeader(
* @param brokerType, the type of broker: classic or artemis
* @return the status (stopped or started) with status 200 (OK) or with status 404 (Not Found)
*/
@GetMapping(path= "/brokers/{brokerType}/queues", produces = {"text/plain","application/xml","application/json"})
@GetMapping(
path= "/brokers/{brokerType}/queues",
produces = {MediaType.APPLICATION_JSON_VALUE, MediaType.APPLICATION_XML_VALUE, MediaType.TEXT_PLAIN_VALUE}
)
public ResponseEntity<String> getQueues(@Parameter(hidden = true) @RequestHeader("Accept") String mediaType, @PathVariable String brokerType) throws Exception {

log.debug("REST request to get get queues");
Expand All @@ -118,7 +131,10 @@ public ResponseEntity<String> getQueues(@Parameter(hidden = true) @RequestHeader
* @param queueName, the name of the queue
* @return the status (stopped or started) with status 200 (OK) or with status 404 (Not Found)
*/
@PostMapping(path = "/brokers/{brokerType}/queue/{queueName}/clear", produces = {"text/plain","application/xml","application/json"})
@PostMapping(
path = "/brokers/{brokerType}/queue/{queueName}/clear",
produces = {MediaType.APPLICATION_JSON_VALUE, MediaType.APPLICATION_XML_VALUE, MediaType.TEXT_PLAIN_VALUE}
)
public ResponseEntity<String> clearQueue(@Parameter(hidden = true) @RequestHeader("Accept") String mediaType, @PathVariable String brokerType, @PathVariable String queueName) throws Exception {

log.debug("REST request to clear queue : {}", queueName);
Expand All @@ -139,7 +155,10 @@ public ResponseEntity<String> clearQueue(@Parameter(hidden = true) @RequestHeade
* @param brokerType, the type of broker: classic or artemis
* @return the status (stopped or started) with status 200 (OK) or with status 404 (Not Found)
*/
@PostMapping(path = "/brokers/{brokerType}/queues/clear", produces = {"text/plain","application/xml","application/json"})
@PostMapping(
path = "/brokers/{brokerType}/queues/clear",
produces = {MediaType.APPLICATION_JSON_VALUE, MediaType.APPLICATION_XML_VALUE, MediaType.TEXT_PLAIN_VALUE}
)
public ResponseEntity<String> clearQueues(@Parameter(hidden = true) @RequestHeader("Accept") String mediaType, @PathVariable String brokerType) throws Exception {

log.debug("REST request to clear queues : this removes all messages on the broker!");
Expand Down
Loading