230.5. 例
以下のルートでは、ハードコーディングされた Bye World メッセージを返す HTTP サーバーとして Netty4 HTTP を使用します。
    from("netty4-http:http://0.0.0.0:8080/foo")
      .transform().constant("Bye World");
    from("netty4-http:http://0.0.0.0:8080/foo")
      .transform().constant("Bye World");
また、以下に示すように、ProducerTemplate を使用して、Camel を使用してこの HTTP サーバーを呼び出すこともできます。
    String out = template.requestBody("netty4-http:http://localhost:8080/foo", "Hello World", String.class);
    System.out.println(out);
    String out = template.requestBody("netty4-http:http://localhost:8080/foo", "Hello World", String.class);
    System.out.println(out);
出力として Bye World が返されます。