Where communities thrive


  • Join over 1.5M+ people
  • Join over 100K+ communities
  • Free without limits
  • Create your own community
People
Activity
    Adrian Soria
    @adrianSoria
    consumers use plain amqConnectionfactory @apoguy
    Earnie Dyke
    @earniedyke

    @earniedyke So it turns out this was working all the time. I believed the data in the source Mongo collection was different from what was in the SOLR collection but it wasn't so that's why I was not seeing any changes.

    I am still a little confused however as there seems to be no response (body or headers) returned from the Solr calls. Is that by design?

    sharpedavid
    @sharpedavid
    hello @bappajubcse05. people idle here and sometimes respond to questions, but it is not fast-paced
    if you have an apache camel question you may or may not receive answer in 24h or less
    D004
    @bappajubcse05
    Does camel disruptor holds the messages even through it is processed completely
    ?
    Andrea Cosentino
    @oscerd
    @bappajubcse05 don't open JIRA for question. Ask here or in the user/Dev mailing list.
    sharpedavid
    @sharpedavid
    so this isn't the final code, I'm just trying something out, but here's some code that sets an Exchange Property using a lambda Expression to access some POJO field:
    .setProperty("messageId", (Exchange exchange, Class<String> type) -> type.cast(exchange.getIn().getBody(DemographicScreeningRequest.class).getDemographicScreening().getMessageID()))
    It's a bit weird to write a lambda because the Expression interface uses a generic method:
    public <T extends Object> T evaluate(Exchange exchange, Class<T> type);
    so you can't, for example, forgo specifying the type Exchange and Class
    I could encapsulate the lambda in an anonymous class, or put the whole thing in a processor and call "process" instead of "setProperty". I just thought setProperty might be clearer for a one-line implementation
    sharpedavid
    @sharpedavid
    actually this doesn't work well

    does anyone know how to use the Java DSL with just:

    .setProperty("messageId")

    It returns a ExpressionClause<ProcessorDefinition<Type>>

    Adrian Soria
    @adrianSoria
    @apoguy also remember that activemq-pool is not jms 2.0 compliant.
    D004
    @bappajubcse05
    @oscerd Thank you for your response. That was a critical problem that I am facing.
    I had explored that link, but it didn't help me
    Andrea Cosentino
    @oscerd
    do you have a reproducer for this?
    Federico Einhorn
    @apoguy
    Thanks @adrianSoria. I actually tested the ActiveMQ components but wasn't able to make it work because of the way the ActiveMQ is configured on the Websphere it's running
    Claus Ibsen
    @davsclaus
    @adrianSoria I think the AMQ team created a new JMS pool component that is both JMS 1.x and 2.x compliant. It has some new name and hosted on github under some other name than Apache
    @raoger give it a try as it may be supported now, the ftp component extends the file component, so give it a try
    sharpedavid
    @sharpedavid

    I'm getting this exception in unit tests while developing my CXF routes:

    Caused by: org.apache.cxf.binding.soap.SoapFault: Index: 0, Size: 0
        at org.apache.cxf.binding.soap.interceptor.Soap12FaultInInterceptor.unmarshalFault(Soap12FaultInInterceptor.java:156)

    None of the stack traces refer to my code except the unit test itself. I'm almost certain this is just caused by a NPE in my code, but I guess one of the handlers is squelching the exception. I can run the debugger to find the NPE, but I'm wondering what could be wrong with my set-up that I'm not getting a stacktrace to the NPE.

    sharpedavid
    @sharpedavid
    Seems like the SoapFault is actually the result of a simple OutOfBounds exception caused by my code, but the stack trace information is totally gone and only the exception message remains.
    sharpedavid
    @sharpedavid

    Hey @davsclaus I've got a possible bug on the camel-maven-plugin that I wonder if I should report. The route validation reports that the "sslContextParameters" parameter is unknown for the HTTP4 component, but I'm pretty sure it's valid.

    --- camel-maven-plugin:2.22.1:validate (default) @ BestAdapter ---
    Detected Camel version used in project: 2.22.1
    Validating using Camel version: 2.22.1
    Endpoint validation error at: com.cgi.best.HealthRoute.configure(HealthRoute.java:20)
    
        https4:{{replaceAll}}?sslContextParameters=#sslParameters&bridgeEndpoint=true&x509HostnameVerifier=#hostnameVerifier
    
            sslContextParameters    Unknown option

    The thing is, I'm pretty certain the option is valid. If disable route validation, everything seems to work, and I certainly need SSL configuration.

    Claus Ibsen
    @davsclaus
    @sharpedavid no that option is only on the component level, not on endpoint
    soilworker01
    @soilworker01
    what's best practice to set let's say a nvl header in a route? if header1 is null then take header2
    .setHeader("newheaderName", simple("nvl(header1, header2)")
    Claus Ibsen
    @davsclaus
    what is nvl
    soilworker01
    @soilworker01
    hi claus, i think it's oracle db specific
    nvl(value, replacewith)
    so if value is null take replacewith
    i want to do the same for a camel route
    if header1 is null take header2 as endpoint
    the endpoint uri is also a header variable
    Claus Ibsen
    @davsclaus
    okay then use something like groovy or mvel or the likes that is more powerful that can do something like that
    instead of simple
    soilworker01
    @soilworker01
    i'm restricted to use java only :(
    Claus Ibsen
    @davsclaus
    you can use a .choice to test if a header is null and
    eg just like you would write it in java with if ... else ...
    soilworker01
    @soilworker01
    yeah i know
    i thought there is some fancy one liner i missed or don't know :)
    Claus Ibsen
    @davsclaus
    no there is not - groovy has the elvis operator
    soilworker01
    @soilworker01
    thx claus!
    Jang-Vijay Singh
    @jvsingh
    Hello, everyone,
    Can someone please tell me how to set the "http connect timeout" on an http invocation?
    Zoran Regvart
    @zregvart
    @jvsingh should be connectTimeout see https://github.com/apache/camel/blob/master/components/camel-http4/src/main/docs/http4-component.adoc (or the documentation of component you're using)
    Jang-Vijay Singh
    @jvsingh
    Thank you
    sharpedavid
    @sharpedavid

    That is quite surprising, @davsclaus, as I am currently successfully relying on this option, sslContextParameters, to provide client certificates. Without it, I get sun.security.validator.ValidatorException, but with it, the request completes successfully. So I am saying that the camel-maven-plugin tells me this option is valid, but my experience is that it is valid and required.

    I'm not sure what you mean by "endpoint" vs "component". I know that a component creates/exposes endpoints, but I don't understand how that's a useful distinction here. I guess I've always used the endpoint configuration, I've never actually created a component.

    Actually, I did find one example of what I'm doing in the official documentation. See here on the HTTP4 adoc page, title "Spring DSL based configuration of endpoint":

    ...
      <camel:sslContextParameters
          id="sslContextParameters">
        <camel:keyManagers
            keyPassword="keyPassword">
          <camel:keyStore
              resource="/users/home/server/keystore.jks"
              password="keystorePassword"/>
        </camel:keyManagers>
      </camel:sslContextParameters>...
    ...
      <to uri="https4://127.0.0.1/mail/?sslContextParameters=#sslContextParameters"/>...

    See, I'm doing something like that, but the camel-maven-plugin says sslContextParameters is an unknown option.

    davidroytenberg
    @davidroytenberg

    I am using Camel ahc-ws to open WebSockets and the documentation says that I can set a AsyncHttpClient on the AHC component and it will be used by the ahc-ws endpoints. However, when I do this,
    the configured AHC client does not get used.

    Since I'm opening WebSockets at URLs that are determined at run time, I have to configure the AsyncHttpClient with a particular RequestFilter containing the appropriate credentials in a processor before making the call to open each WebSocket.  
    
    My splitter picks up the URLs and then calls my WebSocket route.  My processor then sets the AsyncHttpClient on the Ahc Component, before passing control back to the endpoint, but the Ahc-ws endpoint appears to just create a default AsyncHttpClient without the RequestFilter that I need, ignoring the AsyncHttpClient that I've set.

    Here are my routes:

      <route>
              <from uri="timer:trigger?repeatCount=1"/>
              <split>
                    <method bean="silhouetteUrlsBean" method="splitUrls"/>
                    <to uri="log:split"/>
                    <to uri="direct:socketListener"/>
              </split>
       </route>
       <route>
          <from uri="direct:socketListener"/>
           <process ref="webSocketPrep"/>
          <pollEnrich> 
              <simple>ahc-wss://${body}/api/ws </simple> 
         </pollEnrich>
         <to uri="log:DEBUG?showBody=true&amp;showHeaders=true"/> 
         <unmarshal ref="json"/>
       </route>

    The webSocketPrep processor looks up the AHC component and sets up the AsyncHttpClient configured with the RequestFilter that I need to pass in the right credentials in the Header. But the filter never gets called when the endpoint invokes the URL, which is how I know it's not using my configured AsyncHttpClient.

    Is there a way to tell the ahc-wss endpoint to use the AsyncHttpClient configured in the AHC component?