haifzhan opened a new issue #2693:
URL: https://github.com/apache/camel-k/issues/2693


   I have started a Java integration which is listening on port `8843`. The 
integration works properly and it can receive syslog events in the container of 
the pod. I am trying to expose the port and makes it accessible outside of the 
pod, what is the right way to expose it?
   
   I have tried added traits but don't have any luck, I have asked the question 
on 
[StackOverflow](https://stackoverflow.com/questions/69501857/how-to-expose-a-camel-k-integration-pod-port)
 can some shed some light on this?
    
   ```
   // Split commands into multiple lines for easy read
   $ kamel run \
   --trait container.enabled=true  \
   --trait container.expose=true \
   --trait container.port=8443 \
   --trait service.node-port=true \
   SyslogBasic.java --dev
   ```
   
   ```java
   import org.apache.camel.builder.RouteBuilder;
   import org.apache.camel.Exchange;
   import org.apache.camel.Processor;
   import org.apache.camel.spi.DataFormat;
   
   import org.apache.camel.component.syslog.SyslogDataFormat;
   
   public class SysLogBasic extends RouteBuilder {
   
    @Override
     public void configure() throws Exception {
       DataFormat syslogDataFormat = new SyslogDataFormat();
       String HOST = "0.0.0.0";
       int PORT = 8443;
       from("netty:udp://" + HOST + ":" + PORT + 
"?sync=false").unmarshal(syslogDataFormat).process(new Processor() {
         public void process(Exchange exchange) {
           // implemented business logic
         }
       }).to("log:info");
     }
   }
   ```


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscr...@camel.apache.org

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


Reply via email to