예제 #1
0
 @RequestMapping("stop")
 public String stop(@PathVariable("consumerName") String consumerName, ModelMap map)
     throws Exception {
   CamelConnection conn = connectionFactory.getConnection();
   ConsumerOperations ops = conn.getConsumerOperations(consumerName);
   ops.stop();
   map.put("message", "Context '" + consumerName + "' stopped");
   return getRedirect(consumerName);
 }
예제 #2
0
 @RequestMapping("browseMessageBody")
 @ResponseBody
 public String browseMessageBody(
     @RequestParam("endpointName") String endpointName, @RequestParam("offset") int offset)
     throws Exception {
   CamelConnection conn = connectionFactory.getConnection();
   String exchange = conn.getEndpointOperations(endpointName).browseMessageBody(offset);
   return exchange;
 }
예제 #3
0
 @RequestMapping
 public String show(
     @PathVariable("consumerName") String consumerName,
     ModelMap map,
     @RequestParam(value = "message", required = false) String message)
     throws Exception {
   CamelConnection conn = connectionFactory.getConnection();
   CamelBean consumer = conn.getConsumer(consumerName);
   map.put("consumer", consumer);
   map.put("message", message);
   return "consumer";
 }
예제 #4
0
  @RequestMapping(value = "message/{index}", method = RequestMethod.POST)
  public String message(
      @RequestParam("endpointName") String endpointName,
      @PathVariable("index") int index,
      ModelMap map)
      throws Exception {

    CamelConnection conn = connectionFactory.getConnection();
    EndpointOperations ops = conn.getEndpointOperations(endpointName);

    Message message = ops.browseMessageAsXml(index, true);
    map.put("message", message);

    return "message";
  }
예제 #5
0
  @RequestMapping(method = RequestMethod.POST)
  public String show(@RequestParam("endpointName") String endpointName, ModelMap map)
      throws Exception {

    CamelConnection conn = connectionFactory.getConnection();
    EndpointOperations ops = conn.getEndpointOperations(endpointName);

    CamelBean endpoint = conn.getEndpoint(endpointName);
    long queueSize = ops.queueSize();
    endpoint.getProperties().put("queueSize()", queueSize);

    map.put("endpoint", endpoint);

    try {
      List<Message> messages =
          ops.browseRangeMessagesAsXml(0, Math.min((int) queueSize, MAX_OVERVIEW_MESSAGES), false);
      map.put("messages", messages);
    } catch (Exception e) {
    }

    return "endpoint";
  }