Where communities thrive


  • Join over 1.5M+ people
  • Join over 100K+ communities
  • Free without limits
  • Create your own community
People
Activity
    Willem Jiang
    @WillemJiang
    I just found the code of setting address from the bean in CxfRsSpringEndpoint.
    Willian Antunes
    @willianantunes
    With the following:
    String uri = "cxfrs://bean://serviceEndpoint";
    
    CxfRsEndpoint endpoint = camelContext.getEndpoint(uri, CxfRsEndpoint.class);
    CxfRsProducer producer = (CxfRsProducer)endpoint.createProducer();
    
    Exchange exchange = new ExchangeBuilder(camelContext)
            .withBody(6470354)
            .withHeader(CxfConstants.OPERATION_NAME, "reimbursementByDocumentId")
            .withHeader(CxfConstants.CAMEL_CXF_RS_USING_HTTP_API, false)
            .withPattern(ExchangePattern.InOut).build();
    
    producer.process(exchange);
    Usually I first test the component before using it in a route.
    Willem Jiang
    @WillemJiang
    yeah, it should work, the bean:// should create a CxfRsSpringEndpoint for you.
    Willian Antunes
    @willianantunes
    Maybe there's a difference between XML and programmatically approach. I'm gonna debug more to understand why only XML works...
    Willian Antunes
    @willianantunes

    Content of SpringJAXRSClientFactoryBean (XML) :

    beanId = "serviceEndpointViaXML"
    loggingSizeLimit = 0
    loggingFeature = null
    username = null
    password = null
    inheritHeaders = false
    headers = null
    initialState = null
    threadSafe = false
    timeToKeepState = 0
    serviceClass = {Class@6832} "interface br.com.willianantunes.serenata.JarbasAPI"
    proxyLoader = null
    schemaLocations = null
    serviceFactory = {JAXRSServiceFactoryBean@8999} 
    entityProviders = {LinkedList@9000}  size = 0
    providerComparator = null
    bus = {SpringBus@9001} 
    address = "https://jarbas.serenata.ai"
    transportId = null
    bindingId = "http://apache.org/cxf/binding/jaxrs"
    dataBinding = null
    bindingFactory = null
    destinationFactory = null
    publishedEndpointUrl = null
    endpointName = null
    serviceName = null
    properties = {HashMap@9003}  size = 1
    features = null
    bindingConfig = null
    endpointReference = null
    conduitSelector = null
    in = {ModCountCopyOnWriteArrayList@9004}  size = 0
    out = {ModCountCopyOnWriteArrayList@9005}  size = 0
    outFault = {ModCountCopyOnWriteArrayList@9006}  size = 0
    inFault = {ModCountCopyOnWriteArrayList@9007}  size = 0

    Content of SpringJAXRSClientFactoryBean (programmatically) :

    beanId = "serviceEndpoint"
    loggingSizeLimit = 0
    loggingFeature = null
    username = null
    password = null
    inheritHeaders = false
    headers = null
    initialState = null
    threadSafe = false
    timeToKeepState = 0
    serviceClass = {Class@6834} "interface br.com.willianantunes.serenata.JarbasAPI"
    proxyLoader = null
    schemaLocations = null
    serviceFactory = {JAXRSServiceFactoryBean@8997} 
    entityProviders = {LinkedList@8998}  size = 0
    providerComparator = null
    bus = {SpringBus@8999} 
    address = "https://jarbas.serenata.ai"
    transportId = null
    bindingId = "http://apache.org/cxf/binding/jaxrs"
    dataBinding = null
    bindingFactory = null
    destinationFactory = null
    publishedEndpointUrl = null
    endpointName = null
    serviceName = null
    properties = null
    features = null
    bindingConfig = null
    endpointReference = null
    conduitSelector = null
    in = {ModCountCopyOnWriteArrayList@9001}  size = 0
    out = {ModCountCopyOnWriteArrayList@9002}  size = 0
    outFault = {ModCountCopyOnWriteArrayList@9003}  size = 0
    inFault = {ModCountCopyOnWriteArrayList@9004}  size = 0

    It's late and I do not know yet how to resolve this.

    Willem Jiang
    @WillemJiang
    yeah, I think I found the key. in XML spring can hold the properties of the clientFactoryBean, so it can work for the https://github.com/apache/camel/blob/834a59910e4b6b8d089e229b39f6c8673e7c3f9a/components/camel-cxf/src/main/java/org/apache/camel/component/cxf/jaxrs/CxfRsSpringEndpoint.java#L77
    Willian Antunes
    @willianantunes
    @WillemJiang the only difference is the properties which in XML has a value and programmatically doesn't.
    Willem Jiang
    @WillemJiang
    @willianantunes Can you check the value of properties? I think that's the magic
    Willian Antunes
    @willianantunes
    @WillemJiang in XML approach the field properties is a HashMap with one entry: key = "beanId", value = "serviceEndpointViaXML".

    @WillemJiang look what I did:

    @Bean("serviceEndpoint")  
    public SpringJAXRSClientFactoryBean serviceEndpoint() {  
    
        if (StringUtils.isEmpty(serenataJarbasEndpoint))  
            serenataJarbasEndpoint = JarbasAPI.API_DEFAULT_URL;  
    
        SpringJAXRSClientFactoryBean clientFactoryBean = new SpringJAXRSClientFactoryBean();  
        clientFactoryBean.setAddress(serenataJarbasEndpoint);  
        clientFactoryBean.setBeanId("serviceEndpoint");  
        clientFactoryBean.setServiceClass(JarbasAPI.class);  
        Map<String, Object> properties = new HashMap<>();  
        properties.put("beanId", "serviceEndpoint");  
        clientFactoryBean.setProperties(properties);  
    
        return clientFactoryBean;  
    }

    And still nothing...

    Willem Jiang
    @WillemJiang
    CXF leverage the spring bean to the configure work. @Override
    protected void setupJAXRSClientFactoryBean(JAXRSClientFactoryBean cfb, String address) {
    configurer.configureBean(beanId, cfb);
    cfb.setAddress(address);
    cfb.setThreadSafe(true);
    }
    configurer.configureBean(beanId, cfb); <-- this can only work with spring xml bean
    Willian Antunes
    @willianantunes
    The funny thing is that the CxfRsEndpoint is created with the correct SpringJAXRSClientFactoryBean. But the producer creates a new one and does not merge with the existing one.

    configurer.configureBean(beanId, cfb); <-- this can only work with spring xml bean

    Ah! Now I got it...

    Willem Jiang
    @WillemJiang
    It because the address could be override, we need to create a new instance per address.
    Willian Antunes
    @willianantunes
    Is there a way to make both approaches work?
    Maybe I can submit a PR...
    Willem Jiang
    @WillemJiang
    You can use the configure instead the java bean to do the work.
    If you find a way to merge the setting the PR could be great.
    @willianantunes You can put the setting code of JAXRSClientFactoryBean here in the CxfRsEndpointConfigurer.
    Willem Jiang
    @WillemJiang
    @willianantunes Please check if CxfRsEndpointConfigurer is OK for your need, otherwise you need fight for the merge the properties or create a FactoryBean here.
    Willian Antunes
    @willianantunes
    OK! I do it. But I'll probably submit a PR to allow both usages (XML and programmatically). When I test tomorrow I warn you. Thank your for the support!
    Willem Jiang
    @WillemJiang
    I found an bug on the CxfRsEndpointConfigurer setting, if we set the address on the CxfRsEndpoint on the configurer, it always override the addressing setting from message, I just fill a JIRA https://issues.apache.org/jira/browse/CAMEL-12540 for it
    @willianantunes Yeah, Please create a JIRA to track the issue that you reported.
    Willian Antunes
    @willianantunes

    @WillemJiang I's been created: https://issues.apache.org/jira/browse/CAMEL-12541

    I put a "Proposal to make it works" there because either we can merge or use the bean created from the start and available in CxfRsSpringEndpoint.

    Willian Antunes
    @willianantunes
    PR from our discussion: apache/camel#2350
    Willem Jiang
    @WillemJiang
    @willianantunes I will review shortly.
    txjmb
    @txjmb
    Does anyone have insight into the issues I described on 5/25 related to camel-ahc-ws on versions of Camel > 2.17 on Karaf? I think it's a problem with the migration to Netty 4, but I'm not sure how to resolve the issue. And it happens on a very vanilla install. Any help would be greatly appreciated, as we have a need to connect to WebSocket servers with Camel, but would like to stay on a more recent version than 2.17.
    Nicky Moelholm
    @moelholm

    Hi - just checking for a "friend" :smile:

    When I do ... .shareUnitOfWork() .. in the Camel route DSL

    Does that only result in an addition of ShareUnitOfWorkAggregationStrategy ?

    And does it always wrap my own custom aggregation strategy (if any) ?

    Nicky Moelholm
    @moelholm
    ^^^ any experts in here that would like to attempt an answer on this ?
    Ronak Patel
    @ironakpatel
    Hello Team, Not sure if this a right platform to ask such questions, and I am sure one of you may have seen this: https://stackoverflow.com/questions/50610962/camel-2-21-0-pgp-encryption-not-working I would appreciate any help on this
    Juan Sebastián González Rivera
    @JuanSS96_gitlab
    Hi, I'm new in camel, and I have to refactor a project which is written in java and use camel with spring, one of the routers use direct: which is the entry point, but I don't understand very well the documentation, It's "like" a socket?, this executes "like" a trigger?
    This is the router
    <bean id="wmq" class="org.apache.camel.component.jms.JmsComponent">
            <property name="connectionFactory">
                <bean class="com.ibm.mq.jms.MQConnectionFactory">
                    <property name="transportType" value="${config.transportType}"/>
                    <property name="hostName" value="${config.hostname}"/> 
                    <property name="port" value="${config.port}"/> 
                    <property name="queueManager" value="${config.queueManager}"/> 
                    <property name="channel" value="${config.channel}"/> 
                </bean>
            </property>
        </bean>    
    
        <camel:endpoint id="wmqReader" uri="wmq:queue:${config.queue}?useMessageIDAsCorrelationID=true"/>
    
        <camel:routeContext id="QueueReader"> 
            <camel:route id="QueueReaderMQ" autoStartup="false">    
                <camel:from uri="ref:wmqReader"/>
                <camel:to uri="direct:processTransacciones"/>
            </camel:route>        
        </camel:routeContext>
    Ronak Patel
    @ironakpatel
    @JuanSS96_gitlab - It is like a link "to" another endpoint(consumer) see more details and examples here: http://camel.apache.org/direct.html
    Johan Karlsson
    @hochas
    I have a use case where I want to construct a list of datasources to send queries to and I would like to do so in parallell. The connection settings are to be configured in application.properties and the list of datasources created at runtime. Any recommendations on how to best achieve this? A splitter bean which creates all datasources programatically and returns them as an iterable?
    Claus Ibsen
    @davsclaus
    @moelholm yes it wraps always (as intended) so it can deal with the shared UoW logic nessasary. Also documented in its javadoc
    Nicky Moelholm
    @moelholm
    @davsclaus thanks!
    Roman Vottner
    @RovoMe
    I need to connect to a SFTP server and consume all files within a directory if the directory does not contain a lock file (generated by some ERP tool). As the GenericFile does not support such a readLock strategy out of the box I had a look into GenericFileProcessStrategy which I would extend from and customize to my needs. However, I’d like the lock-file name to look for to be dynamically configurable. The SFTP consumer does not yet define such property. What would be the next best option to inject the lock-file name into the strategy?
    Juan Sebastián González Rivera
    @JuanSS96_gitlab
    @sukhil88 Thanks
    Ronak Patel
    @ironakpatel
    @davsclaus
    @davsclaus
    Any input on my question from June 1st
    Andrea Cosentino
    @oscerd
    @sukhil88 it looks like the signature of the constructor has been changed.
    ravi21588
    @ravi21588
    Hi I have stored SFTP password in Jboss vault.Also i have created a system property myfusepassword <property name="myfusepassword " value="${VAULT::source_ftp::password::1}"/> .In the SFTP options i have specified password as ${sys.myfusepassword}.Still Iam not able to connect to SFTP server the endpoint configuration is as below <from id="Endpoint" uri="sftp:{{esb.source.sourceFtpHostname}}:22/{{esb.source.directoryName}}?siteCommand=NAMEFMT 1&stepwise=false&fileName={{esb.source.fileName}}&password=${sys.esb.source.sftpPwd}&username={{esb.source.sourceFtpUname}}&useList=false&delete=true&delay={{esb.source.pollingDelay}}&streamDownload=true"/>
    Am i missing any configuration?
    Marco Huygen
    @marcohuygen_twitter
    Hi all, I am trying to setup a RabbitMQ producer and specify skipQueueDeclare=false. But because a queue is always initialized with a uuid it is always created. Is there a way to set queue = null or another way to stop my producer from creating queues... Many thx
    Simon Temple
    @simon-temple

    Exchange getOut() == null after ProducerTemplate.request().. can you help (using 2.18.1)

            ProducerTemplate producer = camelContext.createProducerTemplate();
    
            Exchange out = producer.request( endpointUri, new Processor() {
                @Override
                public void process( Exchange ex ) {
                    ex.setIn( exchange.getIn() );
                }
            } );

    My debugger show the out message is set in the consumer endpoint. Yet the request() call does not return it?

    Simon Temple
    @simon-temple
    So I'm attempting to perform a generic sync request/response and then get at the response headers and body... perhaps this is not the correct way to do it?
    Any help much appreciated.