code: public void parseSNMP(Exchange exchange)
      {
          Message inMsg = exchange.getIn();
          Map<String, Object> inHeaders = inMsg.getHeaders();
          exchange.getOut().setHeaders(inHeaders);
  
          StringBuilder body = new StringBuilder();
          body.append("<message>");
  
          body.append("<header>");
  
          body.append("<sender>");
          body.append(((UdpAddress) inHeaders.get("peerAddress")).getInetAddress().getHostAddress());
          body.append("</sender>");
  
          body.append("<type>");
          body.append("snmp");
          body.append("</type>");
  
          body.append("<timestamp>");
          body.append(new Date().getTime());
          body.append("</timestamp>");
  
          body.append("<version>");
          body.append("1.0");
          body.append("</version>");
  
          body.append("</header>");
  
          body.append("<body>");
          body.append(inMsg.getBody(String.class));
          body.append("</body>");
  
          body.append("</message>");
  
          exchange.getOut().setBody(body.toString());
      }
docs: SNMPを含むExchangeをパースする
  
  @param exchange SNMPを含むExchange