get consumers and producers info within Camel

2020-10-22 Thread CASAUX Nicolas
Hello !

I would like to retrieve date of the consumers and the producers of my Camel 
context (org.apache.camel.management.mbean.ManagedConsumer and 
org.apache.camel.management.mbean.ManagedProducer)

As I'm using Camel 3.6.0, I used this:
getContext().getExtension(ManagedCamelContext.class)

>From there, I can retrieve ManagedProcessor, ManagedRoute, and many other 
>functions.
But I can't find a way to retrieve the consumers and the producers info.

I managed however, to retrieve consumers and producers info using directly 
queries to request the MBean server (like proposed here: 
https://stackoverflow.com/questions/22717446/get-information-about-all-camelcontext-defined-in-a-vm),
 but I feel it's a bit over complicated.

Is there a better way to get access to those managed beans ?

Thanks in advance !

Regards,
Nicolas


RE: get consumers and producers info within Camel

2020-10-22 Thread CASAUX Nicolas
Sorry for the typo, not "date" but "data" of the consumers and the producers of 
my Camel context...

-Message d'origine-
De : CASAUX Nicolas  
Envoyé : jeudi 22 octobre 2020 09:32
À : users@camel.apache.org
Objet : get consumers and producers info within Camel

Hello !

I would like to retrieve date of the consumers and the producers of my Camel 
context (org.apache.camel.management.mbean.ManagedConsumer and 
org.apache.camel.management.mbean.ManagedProducer)

As I'm using Camel 3.6.0, I used this:
getContext().getExtension(ManagedCamelContext.class)

>From there, I can retrieve ManagedProcessor, ManagedRoute, and many other 
>functions.
But I can't find a way to retrieve the consumers and the producers info.

I managed however, to retrieve consumers and producers info using directly 
queries to request the MBean server (like proposed here: 
https://stackoverflow.com/questions/22717446/get-information-about-all-camelcontext-defined-in-a-vm),
 but I feel it's a bit over complicated.

Is there a better way to get access to those managed beans ?

Thanks in advance !

Regards,
Nicolas


Re: get consumers and producers info within Camel

2020-10-22 Thread Claus Ibsen
Hi

You can find the consumers and producers via the mbean server where
you can find them in the jmx tree.

See the unit tests in camel-core where you can find examples of that
such as ManagedProducerTest

On Thu, Oct 22, 2020 at 9:34 AM CASAUX Nicolas
 wrote:
>
> Sorry for the typo, not "date" but "data" of the consumers and the producers 
> of my Camel context...
>
> -Message d'origine-
> De : CASAUX Nicolas 
> Envoyé : jeudi 22 octobre 2020 09:32
> À : users@camel.apache.org
> Objet : get consumers and producers info within Camel
>
> Hello !
>
> I would like to retrieve date of the consumers and the producers of my Camel 
> context (org.apache.camel.management.mbean.ManagedConsumer and 
> org.apache.camel.management.mbean.ManagedProducer)
>
> As I'm using Camel 3.6.0, I used this:
> getContext().getExtension(ManagedCamelContext.class)
>
> From there, I can retrieve ManagedProcessor, ManagedRoute, and many other 
> functions.
> But I can't find a way to retrieve the consumers and the producers info.
>
> I managed however, to retrieve consumers and producers info using directly 
> queries to request the MBean server (like proposed here: 
> https://stackoverflow.com/questions/22717446/get-information-about-all-camelcontext-defined-in-a-vm),
>  but I feel it's a bit over complicated.
>
> Is there a better way to get access to those managed beans ?
>
> Thanks in advance !
>
> Regards,
> Nicolas



-- 
Claus Ibsen
-
http://davsclaus.com @davsclaus
Camel in Action 2: https://www.manning.com/ibsen2


Camel CXF with SOAP 1.1 and SOAP 1.2

2020-10-22 Thread Shenavai, Manuel
Hi everyone,

I have a question regarding the camel CXF component. I setup a cxfEndpoint 
using a SOAP 1.2 WSDL, endpoint & port. This allows to call the endpoint with 
SOAP 1.2. But when I call the endpoint with SOAP 1.1 messages, I got different 
results. In CamelBlueprintTestSupport this works (with SOAP 1.1 request I get 
SOAP 1.1 response), but in my real application it fails. With SOAP 1.1 the 
route is entered, but an error occurs when the response is trying to be send 
(logs attached, HIERARCHY_REQUEST_ERR: An attempt was made to insert a node 
where it is not permitted)

What is the expected behavior in this use-case? Should a SOAP1.2 Endpoint be 
able to handle SOAP1.1 message?

Thanks in advance &
Best regards,
Manuel


2020 10 19 
09:41:18#+00#WARN#org.apache.cxf.phase.PhaseInterceptorChain##P1940723736#https-jsse-nio-8041-exec-19###hil88r539g#na#na#na#na#Interceptor
 for 
{http://camel.apache.org/cxf/jaxws/provider}service\#{http://camel.apache.org/cxf/jaxws/provider}invoke
 has thrown exception, unwinding noworg.w3c.dom.DOMException: 
HIERARCHY_REQUEST_ERR: An attempt was made to insert a node where it is not 
permitted. 
at 
com.sun.org.apache.xerces.internal.dom.CoreDocumentImpl.insertBefore(CoreDocumentImpl.java:439)
at 
com.sun.org.apache.xerces.internal.dom.NodeImpl.appendChild(NodeImpl.java:237)
at 
com.sun.xml.messaging.saaj.soap.SOAPPartImpl.appendChild(SOAPPartImpl.java:498)
at 
org.apache.cxf.staxutils.W3CDOMStreamWriter.setChild(W3CDOMStreamWriter.java:122)
at 
org.apache.cxf.staxutils.W3CDOMStreamWriter.newChild(W3CDOMStreamWriter.java:112)
at 
org.apache.cxf.staxutils.W3CDOMStreamWriter.createAndAddElement(W3CDOMStreamWriter.java:166)
at 
org.apache.cxf.staxutils.OverlayW3CDOMStreamWriter.createAndAddElement(OverlayW3CDOMStreamWriter.java:65)
at 
org.apache.cxf.binding.soap.saaj.SAAJStreamWriter.createAndAddElement(SAAJStreamWriter.java:193)
at 
org.apache.cxf.staxutils.W3CDOMStreamWriter.writeStartElement(W3CDOMStreamWriter.java:143)
at 
org.apache.cxf.staxutils.OverlayW3CDOMStreamWriter.writeStartElement(OverlayW3CDOMStreamWriter.java:210)
at 
org.apache.cxf.binding.soap.interceptor.SoapOutInterceptor.writeSoapEnvelopeStart(SoapOutInterceptor.java:132)
at 
org.apache.cxf.binding.soap.interceptor.SoapOutInterceptor.handleMessage(SoapOutInterceptor.java:87)
at 
org.apache.cxf.binding.soap.interceptor.SoapOutInterceptor.handleMessage(SoapOutInterceptor.java:67)
at 
org.apache.cxf.phase.PhaseInterceptorChain.doIntercept(PhaseInterceptorChain.java:308)
at 
org.apache.cxf.interceptor.OutgoingChainInterceptor.handleMessage(OutgoingChainInterceptor.java:83)
at 
org.apache.cxf.phase.PhaseInterceptorChain.doIntercept(PhaseInterceptorChain.java:308)
at 
org.apache.cxf.transport.ChainInitiationObserver.onMessage(ChainInitiationObserver.java:121)
at 
org.apache.cxf.transport.http.AbstractHTTPDestination.invoke(AbstractHTTPDestination.java:267)
at 
org.apache.cxf.transport.servlet.ServletController.invokeDestination(ServletController.java:234)
at 
org.apache.cxf.transport.servlet.ServletController.invoke(ServletController.java:208)
at 
org.apache.cxf.transport.servlet.ServletController.invoke(ServletController.java:160)
at 
org.apache.cxf.transport.servlet.CXFNonSpringServlet.invoke(CXFNonSpringServlet.java:189)
at 
org.apache.cxf.transport.servlet.AbstractHTTPServlet.handleRequest(AbstractHTTPServlet.java:303)
at 
org.apache.cxf.transport.servlet.AbstractHTTPServlet.doPost(AbstractHTTPServlet.java:222)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:707)
at 
org.apache.cxf.transport.servlet.AbstractHTTPServlet.service(AbstractHTTPServlet.java:278)
at 
org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:231)
at 
org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:166)
at 
org.apache.tomcat.websocket.server.WsFilter.doFilter(WsFilter.java:52)
at 
org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:193)
at 
org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:166)
at 
com.sap.esb.security.cloud.authentication.CloudAuthenticationFilter.doFilter(CloudAuthenticationFilter.java:57)
at 
org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:193)
at 
org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:166)
at 
org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:199)
at 
org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:96)
at 
org.ops4j.pax.web.service.tomcat.internal.ServiceValve.invoke(ServiceValve.java:51)
at 
org.apac

Mocking a class in a script

2020-10-22 Thread Иванов Григорий -

Hi

I have a production route with a groovy script I should test, is there a way to 
mock URL class or do something else to not really make a request to production 
API? The problem is that besides the request part it have some other stuff I 
would like to be tested.

I agree, this route is not as testable as it could be, but for now it comes "as 
is". Could you suggest something?







... some stuff I should test ...
def r = new 
URL("http://someproductoinservice.com";).openConnection();
r.with {
setRequestMethod("POST")
setConnectTimeout(6)
setReadTimeout(30)
setDoOutput(true)
setRequestProperty("Content-Type", "application/json")

getOutputStream().write(request.getHeader('inMsg').getBytes("UTF-8"));
}
r.getResponseCode();
... more stuff ...


...




Re: Mocking a class in a script

2020-10-22 Thread Mantas Gridinas
Id suggest providing URL as an argument, but this looks too complex to be
shoved in a groovy script.

On Thu, Oct 22, 2020, 12:54 Иванов Григорий -  wrote:

>
> Hi
>
> I have a production route with a groovy script I should test, is there a
> way to mock URL class or do something else to not really make a request to
> production API? The problem is that besides the request part it have some
> other stuff I would like to be tested.
>
> I agree, this route is not as testable as it could be, but for now it
> comes "as is". Could you suggest something?
>
>
> 
>
> 
> 
> 
> ... some stuff I should test ...
> def r = new URL("http://someproductoinservice.com
> ").openConnection();
> r.with {
> setRequestMethod("POST")
> setConnectTimeout(6)
> setReadTimeout(30)
> setDoOutput(true)
> setRequestProperty("Content-Type", "application/json")
>
> getOutputStream().write(request.getHeader('inMsg').getBytes("UTF-8"));
> }
> r.getResponseCode();
> ... more stuff ...
> 
> 
> ...
> 
>
>


Re: Camel CXF with SOAP 1.1 and SOAP 1.2

2020-10-22 Thread Peter Turányi

Hello.
Sorry, I don't know answer.
But tell me how do you configure cxf beast to work with Camel Apache. I have 
tried but I have no luck. :(
__
> Od: "Shenavai, Manuel [via Camel]" 
> Komu: "PT" 
> Dátum: 22.10.2020 10:27
> Predmet: Camel CXF with SOAP 1.1 and SOAP 1.2
>
Hi everyone,
 
I have a question regarding the camel CXF component. I setup a cxfEndpoint using a 
SOAP 1.2 WSDL, endpoint & port. This allows to call the endpoint with SOAP 1.2. 
But when I call the endpoint with SOAP 1.1 messages, I got different results. In 
CamelBlueprintTestSupport this works (with SOAP 1.1 request I get SOAP 1.1 
response), but in my real application it fails. With SOAP 1.1 the route is entered, 
but an error occurs when the response is trying to be send (logs attached, 
HIERARCHY_REQUEST_ERR: An attempt was made to insert a node where it is not 
permitted)
 
What is the expected behavior in this use-case? Should a SOAP1.2 Endpoint be 
able to handle SOAP1.1 message?
 
Thanks in advance &
Best regards,
Manuel
 
 

 error.txt (7K) Download Attachment 


If you reply to this email, your message will be added to the discussion 
below:http://camel.465427.n5.nabble.com/Camel-CXF-with-SOAP-1-1-and-SOAP-1-2-tp5891227.html 
To 
unsubscribe from Camel - Users, click here 
.
NAML 



RE: Camel CXF with SOAP 1.1 and SOAP 1.2

2020-10-22 Thread Peter Turányi

I am sorry but I didn't found any useful code there.
 
My project contains standard app class
public static void main(String[] args) {
   SpringApplication.run(Application.class, args);
}route class
package org.demo.routes;

import org.apache.camel.builder.RouteBuilder;
import org.demo.processors.Country2KrajinaProcessor;
import org.demo.processors.FullCountryInfoRequestXmlBuilder;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Component;

@Component
public class soap2soapRoute extends RouteBuilder {
   @Override
public void configure() throws Exception {
   from("cxf:countryInfoProxyService").routeId("FullCountryInfo")
   .log("Unmarshalled output: ${body} ")
   .removeHeaders("*");
   }
}but result is 
org.apache.camel.RuntimeCamelException: 
org.apache.camel.FailedToCreateRouteException: Failed to create route 
FullCountryInfo: Route(FullCountryInfo)[[From[cxf:countryInfoProxyService]] 
-... because of serviceClass must be specified
__

Od: "Shenavai, Manuel" 
Komu: "peter.tura...@pobox.sk" 
Dátum: 22.10.2020 15:06
Predmet: RE: Camel CXF with SOAP 1.1 and SOAP 1.2


Hi Peter,
 
my code looks similar to whats provided in the docs:
https://camel.apache.org/components/latest/cxf-component.html 

 
Hope this helps.
Best regards,
Manuel
 
From: Peter Turányi  
Sent: Donnerstag, 22. Oktober 2020 10:50

To: users@camel.apache.org
Subject: Re: Camel CXF with SOAP 1.1 and SOAP 1.2
 
Hello.
Sorry, I don't know answer.
But tell me how do you configure cxf beast to work with Camel Apache. I have 
tried but I have no luck. :(
__
> Od: "Shenavai, Manuel [via Camel]" 
> Komu: "PT" 
> Dátum: 22.10.2020 10:27
> Predmet: Camel CXF with SOAP 1.1 and SOAP 1.2
>
Hi everyone,
 
I have a question regarding the camel CXF component. I setup a cxfEndpoint using a 
SOAP 1.2 WSDL, endpoint & port. This allows to call the endpoint with SOAP 1.2. 
But when I call the endpoint with SOAP 1.1 messages, I got different results. In 
CamelBlueprintTestSupport this works (with SOAP 1.1 request I get SOAP 1.1 
response), but in my real application it fails. With SOAP 1.1 the route is entered, 
but an error occurs when the response is trying to be send (logs attached, 
HIERARCHY_REQUEST_ERR: An attempt was made to insert a node where it is not 
permitted)
 
What is the expected behavior in this use-case? Should a SOAP1.2 Endpoint be 
able to handle SOAP1.1 message?
 
Thanks in advance &
Best regards,
Manuel
 
 

error.txt (7K)  Download Attachment 

 
If you reply to this email, your message will be added to the discussion below:
http://camel.465427.n5.nabble.com/Camel-CXF-with-SOAP-1-1-and-SOAP-1-2-tp5891227.html 

To unsubscribe from Camel - Users,  click here 
.
NAML 




RE: Camel CXF with SOAP 1.1 and SOAP 1.2

2020-10-22 Thread Shultz, Dmitry
Reading the error message (and specifying serviceClass url parameter as it 
clearly asks) should help.


From: Peter Turányi [mailto:peter.tura...@pobox.sk]
Sent: Thursday, October 22, 2020 6:33 AM
To: users@camel.apache.org
Subject: RE: Camel CXF with SOAP 1.1 and SOAP 1.2


I am sorry but I didn't found any useful code there.



My project contains standard app class

public static void main(String[] args) {


SpringApplication.run(Application.class, args);


}

route class

package org.demo.routes;




import org.apache.camel.builder.RouteBuilder;


import org.demo.processors.Country2KrajinaProcessor;


import org.demo.processors.FullCountryInfoRequestXmlBuilder;


import org.springframework.beans.factory.annotation.Autowired;


import org.springframework.stereotype.Component;




@Component


public class soap2soapRoute extends RouteBuilder {


@Override


 public void configure() throws Exception {


from("cxf:countryInfoProxyService").routeId("FullCountryInfo")


.log("Unmarshalled output: ${body} ")


.removeHeaders("*");


}


}

but result is

org.apache.camel.RuntimeCamelException: 
org.apache.camel.FailedToCreateRouteException: Failed to create route 
FullCountryInfo: Route(FullCountryInfo)[[From[cxf:countryInfoProxyService]] 
-... because of serviceClass must be specified

__
> Od: "Shenavai, Manuel" 
> mailto:manuel.shena...@sap.com>>
> Komu: "peter.tura...@pobox.sk" 
> mailto:peter.tura...@pobox.sk>>
> Dátum: 22.10.2020 15:06
> Predmet: RE: Camel CXF with SOAP 1.1 and SOAP 1.2
>
Hi Peter,

my code looks similar to whats provided in the docs:
https://camel.apache.org/components/latest/cxf-component.html 
[camel.apache.org]

Hope this helps.
Best regards,
Manuel

From: Peter Turányi mailto:peter.tura...@pobox.sk>>
Sent: Donnerstag, 22. Oktober 2020 10:50
To: users@camel.apache.org
Subject: Re: Camel CXF with SOAP 1.1 and SOAP 1.2


Hello.

Sorry, I don't know answer.

But tell me how do you configure cxf beast to work with Camel Apache. I have 
tried but I have no luck. :(

__
> Od: "Shenavai, Manuel [via Camel]" 
> mailto:ml+s465427n5891227...@n5.nabble.com>>
> Komu: "PT" mailto:peter.tura...@pobox.sk>>
> Dátum: 22.10.2020 10:27
> Predmet: Camel CXF with SOAP 1.1 and SOAP 1.2
>
Hi everyone,

I have a question regarding the camel CXF component. I setup a cxfEndpoint 
using a SOAP 1.2 WSDL, endpoint & port. This allows to call the endpoint with 
SOAP 1.2. But when I call the endpoint with SOAP 1.1 messages, I got different 
results. In CamelBlueprintTestSupport this works (with SOAP 1.1 request I get 
SOAP 1.1 response), but in my real application it fails. With SOAP 1.1 the 
route is entered, but an error occurs when the response is trying to be send 
(logs attached, HIERARCHY_REQUEST_ERR: An attempt was made to insert a node 
where it is not permitted)

What is the expected behavior in this use-case? Should a SOAP1.2 Endpoint be 
able to handle SOAP1.1 message?

Thanks in advance &
Best regards,
Manuel



[Image removed by sender.]error.txt (7K) Download Attachment 
[camel.465427.n5.nabble.com]


If you reply to this email, your message will be added to the discussion below:
http://camel.465427.n5.nabble.com/Camel-CXF-with-SOAP-1-1-and-SOAP-1-2-tp5891227.html
 
[camel.465427.n5.nabble.com]
To unsubscribe from Camel - Users, click here 
[camel.465427.n5.nabble.com].
NAML 
[camel.465427.n5.nabble.com]


Re: Camel CXF with SOAP 1.1 and SOAP 1.2

2020-10-22 Thread Peter Turányi

Excuse me. I am newbee in this area. I don't know where and how to specify 
serviceClass.My project contains WSDL and respective classes generated by 
cxf-codegen-plugin WSDL2JAVA.Dňa 22. 10. 2020 o 18:00 dimas [via Camel] 
napísal(a):Reading the error message (and specifying serviceClass url parameter 
as it clearly asks) should help.
 
 
From: Peter Turányi [mailto:[hidden email] ] 
Sent: Thursday, October 22, 2020 6:33 AM

To: [hidden email] 
Subject: RE: Camel CXF with SOAP 1.1 and SOAP 1.2
 
I am sorry but I didn't found any useful code there.
 
My project contains standard app class
public static void main(String[] args) {     
SpringApplication.run(Application.class, args); }route class
package org.demo.routes;  import org.apache.camel.builder.RouteBuilder; import 
org.demo.processors.Country2KrajinaProcessor; import org.demo.processors.FullCountryInfoRequestXmlBuilder; import 
org.springframework.beans.factory.annotation.Autowired; import org.springframework.stereotype.Component;  @Component 
public class soap2soapRoute extends RouteBuilder {     @Override  public void configure() throws Exception {     
from("cxf:countryInfoProxyService").routeId("FullCountryInfo")     
.log("Unmarshalled output: ${body} ")     .removeHeaders("*");     } }but result is 
org.apache.camel.RuntimeCamelException: 
org.apache.camel.FailedToCreateRouteException: Failed to create route 
FullCountryInfo: Route(FullCountryInfo)[[From[cxf:countryInfoProxyService]] 
-... because of serviceClass must be specified
__
> Od: "Shenavai, Manuel" <[hidden email] 
>
> Komu: "[hidden email] " <[hidden email] 
>
> Dátum: 22.10.2020 15:06
> Predmet: RE: Camel CXF with SOAP 1.1 and SOAP 1.2
>
Hi Peter,
 
my code looks similar to whats provided in the docs:
https://camel.apache.org/components/latest/cxf-component.html [camel.apache.org] 

 
Hope this helps.
Best regards,
Manuel
 
From: Peter Turányi <[hidden email] > 
Sent: Donnerstag, 22. Oktober 2020 10:50

To: [hidden email] 
Subject: Re: Camel CXF with SOAP 1.1 and SOAP 1.2
 
Hello.
Sorry, I don't know answer.
But tell me how do you configure cxf beast to work with Camel Apache. I have 
tried but I have no luck. :(
__
> Od: "Shenavai, Manuel [via Camel]" <[hidden email] 
>
> Komu: "PT" <[hidden email] >
> Dátum: 22.10.2020 10:27
> Predmet: Camel CXF with SOAP 1.1 and SOAP 1.2
>
Hi everyone,
 
I have a question regarding the camel CXF component. I setup a cxfEndpoint using a 
SOAP 1.2 WSDL, endpoint & port. This allows to call the endpoint with SOAP 1.2. 
But when I call the endpoint with SOAP 1.1 messages, I got different results. In 
CamelBlueprintTestSupport this works (with SOAP 1.1 request I get SOAP 1.1 
response), but in my real application it fails. With SOAP 1.1 the route is entered, 
but an error occurs when the response is trying to be send (logs attached, 
HIERARCHY_REQUEST_ERR: An attempt was made to insert a node where it is not 
permitted)
 
What is the expected behavior in this use-case? Should a SOAP1.2 Endpoint be 
able to handle SOAP1.1 message?
 
Thanks in advance &
Best regards,
Manuel
 
 

error.txt (7K)  Download Attachment [camel.465427.n5.nabble.com] 

 
If you reply to this email, your message will be added to the discussion below:
http://camel.465427.n5.nabble.com/Camel-CXF-with-SOAP-1-1-and-SOAP-1-2-tp5891227.html 
[camel.465427.n5.nabble.com] 

To unsubscribe from Camel - Users,  click here [camel.465427.n5.nabble.com] 
.
NAML [camel.465427.n5.nabble.com] 



If you reply to this email, your message will be added