Re: Camel throws StackOverflowException while converting message body

2013-08-27 Thread Valery
i tried that, it didn't work. There was the same error but in
CxfProducer.class. Code in headerSetterprocessor was copied from CxfProducer
(i explained why in comments in HeaderSetterprocessor).

Best,
valery



--
View this message in context: 
http://camel.465427.n5.nabble.com/Camel-throws-StackOverflowException-while-converting-message-body-tp5737854p5738014.html
Sent from the Camel - Users mailing list archive at Nabble.com.


Re: appending to value in cache

2013-08-27 Thread Claus Ibsen
Hi

You would likely need to get the existing value from cache and then
append the data to it, and then update the value to the cache.



On Mon, Aug 26, 2013 at 8:34 PM, Tyler Durvik phangb...@gmail.com wrote:
 Yes, you can update a value in a cache but I am having problems trying to
 append to a value in the cache.



 On Mon, Aug 26, 2013 at 1:56 PM, Christian Posta
 christian.po...@gmail.comwrote:

 You should be able to update it. Take a look at the wiki here for the
 correct headers to use:
 http://camel.apache.org/cache.html

 And for a better example, take a look at this unit test:

 https://github.com/apache/camel/blob/master/components/camel-cache/src/test/java/org/apache/camel/component/cache/CacheProducerTest.java#L268



 On Mon, Aug 26, 2013 at 10:31 AM, Tyler Durvik phangb...@gmail.com
 wrote:

  I have a String value stored in a cache (camel cache endpoint) that I may
  want to append to.  Is there an easy way of doing this?  I cannot figure
  out the best way to do this.
 



 --
 *Christian Posta*
 http://www.christianposta.com/blog
 twitter: @christianposta




-- 
Claus Ibsen
-
Red Hat, Inc.
Email: cib...@redhat.com
Twitter: davsclaus
Blog: http://davsclaus.com
Author of Camel in Action: http://www.manning.com/ibsen


STOMP: Exception: The maximum command length was exceeded

2013-08-27 Thread apara
Hi Group,

I am trying to send a message to activeMQ broker via Camel.  However, I am
getting a Maximum protocol buffer length exeeded exception.  Not sure what
I am doing wrong.  I am able to send STOMP messages using spring's
JmsTemplate directly.

Broker Configuration (embedded):
=

//Create a new broker
//
final BrokerService broker = new BrokerService();

//Create the network connector
//
final TransportConnector
tcpConnector =
broker.addConnector(tcp://0.0.0.0:61613),
stompConnector =
broker.addConnector(stomp:0.0.0.0:61623),
wsConnector =
broker.addConnector(ws://0.0.0.0:61633);

broker.start();

Camel Spring Wiring
=



bean class=org.apache.camel.component.stomp.StompComponent
property name=brokerURL value=tcp://localhost:61613 /
/bean

camel:camelContext
camel:route
camel:from uri=direct:sample/engine/user /
camel:to uri=stomp:topic/dm6 /
/camel:route
/camel:camelContext

Producer:
=
interface _Producer {
void onUserEarningEvent(UserEarningEvent e);
}

@Component
public class UserEventProducer implements _Producer {

@Produce(uri = direct:sample/engine/user)
private _Producer
producer;

@Override
public void onUserEarningEvent(final UserEarningEvent e) {
producer.onUserEarningEvent(e);
}
}


Exception: The maximum command length was exceeded
=
org.apache.camel.FailedToCreateRouteException: Failed to create route route1
at:  To[stomp:queue:dm6]  in route:
Route(route1)[[From[direct:gozing/engine/user]] - [To[stomp... because of
Failed to resolve endpoint: stomp://queue:dm6 due to: The maximum command
length was exceeded
at
org.apache.camel.model.RouteDefinition.addRoutes(RouteDefinition.java:912)
at
org.apache.camel.model.RouteDefinition.addRoutes(RouteDefinition.java:177)
at
org.apache.camel.impl.DefaultCamelContext.startRoute(DefaultCamelContext.java:770)
at
org.apache.camel.impl.DefaultCamelContext.startRouteDefinitions(DefaultCamelContext.java:1914)
at
org.apache.camel.impl.DefaultCamelContext.doStartCamel(DefaultCamelContext.java:1670)
at
org.apache.camel.impl.DefaultCamelContext.doStart(DefaultCamelContext.java:1544)
at
org.apache.camel.spring.SpringCamelContext.doStart(SpringCamelContext.java:179)
at org.apache.camel.support.ServiceSupport.start(ServiceSupport.java:61)
at
org.apache.camel.impl.DefaultCamelContext.start(DefaultCamelContext.java:1512)
at
org.apache.camel.spring.SpringCamelContext.maybeStart(SpringCamelContext.java:228)
at
org.apache.camel.spring.SpringCamelContext.onApplicationEvent(SpringCamelContext.java:118)
Caused by: 
java.net.ProtocolException: The maximum command length was exceeded
at
org.fusesource.hawtdispatch.transport.AbstractProtocolCodec.readUntil(AbstractProtocolCodec.java:386)
at
org.fusesource.stomp.codec.StompProtocolCodec.access$000(StompProtocolCodec.java:29)
at
org.fusesource.stomp.codec.StompProtocolCodec$1.apply(StompProtocolCodec.java:56)
at
org.fusesource.hawtdispatch.transport.AbstractProtocolCodec.read(AbstractProtocolCodec.java:355)
at
org.fusesource.hawtdispatch.transport.TcpTransport.drainInbound(TcpTransport.java:656)
at
org.fusesource.hawtdispatch.transport.TcpTransport$6.run(TcpTransport.java:538)
at
org.fusesource.hawtdispatch.internal.NioDispatchSource$3.run(NioDispatchSource.java:209)
at
org.fusesource.hawtdispatch.internal.SerialDispatchQueue.run(SerialDispatchQueue.java:100)
at
org.fusesource.hawtdispatch.internal.pool.SimpleThread.run(SimpleThread.java:77)

Does anyone has any ideas what may be wrong?  Also, not sure where the
source code for camel-stomp module is located.

Thanks for any help...

-AP_



--
View this message in context: 
http://camel.465427.n5.nabble.com/STOMP-Exception-The-maximum-command-length-was-exceeded-tp5738017.html
Sent from the Camel - Users mailing list archive at Nabble.com.


Re: Camel RabbitMQ from 2.12 snapshot - missing parameter type:direct

2013-08-27 Thread Willem jiang
Hi  

Camel RabbitMQ doesn't support to set the type currently.  
The type value is direct, with the code like this:
channel.exchangeDeclare(endpoint.getExchangeName(),
direct,
endpoint.isDurable(),
endpoint.isAutoDelete(),
new HashMapString, Object());

I just found the below code doesn't follow the configuration of endpoint

hannel.queueDeclare(endpoint.getQueue(), true, false, false, null);
That is reason which causes the channel was closed.

I just updated the code, and push it into git central repo, please check it out 
to verify the fix.  

--  
Willem Jiang

Red Hat, Inc.
Web: http://www.redhat.com
Blog: http://willemjiang.blogspot.com (http://willemjiang.blogspot.com/) 
(English)
  http://jnn.iteye.com (http://jnn.javaeye.com/) (Chinese)
Twitter: willemjiang  
Weibo: 姜宁willem





On Tuesday, August 27, 2013 at 12:51 PM, tushmish wrote:

 Hi,
  
 I am trying to use RabbitMQ component from Camel 2.12 Snapshot. I am trying
 to read messages from queue into camel exchange.
  
 Route definition
  
 route id=getMessageFromBroker
 from
 uri=rabbitmq://localhost:5672/myExchange?durable=trueamp;queue=myQueueamp;username=guestamp;password=guestamp;routingKey=aaa/
 bean ref=rabbitMQProcessor
 method=getMessageFromBroker(org.apache.camel.Exchange)/  
 to uri=http4://in.yahoo.com (http://in.yahoo.com)/
 /route
  
 getMessageFromBroker - where the message body is read.
  
 In RabbitMQ - using Web Management console,  
 Exchange - myExchange has been created. with type = direct, durable = true.
 Queue - myQueue has been created and binded to myexchange with routingKey =
 aaa.
  
 However, on loading the camel context, I get this error.
 channel error; reason: {#methodchannel.close(reply-code=406,
 reply-text=PRECONDITION_FAILED - cannot redeclare exchange 'myExchange' in
 vhost '/' with different type, durable, internal or autodelete value,
 class-id=40, method-id=10), null, }
  
 The error is self explicable. But I am not redeclaring myExchange here. I
 looked at the Options section here - http://camel.apache.org/rabbitmq.html.
 But I do not find an option for 'type'. May this be the problem ?
  
 What am I missing ?  
  
 Thanks for your time.
  
 Tushar
  
  
  
  
  
 --
 View this message in context: 
 http://camel.465427.n5.nabble.com/Camel-RabbitMQ-from-2-12-snapshot-missing-parameter-type-direct-tp5738013.html
 Sent from the Camel - Users mailing list archive at Nabble.com 
 (http://Nabble.com).





Re: STOMP: Exception: The maximum command length was exceeded

2013-08-27 Thread Bharath
Hi,

Try using Stomp protocol over NIO transport.For better scalability
(and performance) you might want to run Stomp protocol over NIO transport.
To do that just use stomp+nio transport prefix instead of stomp.

 For example, add the following transport configuration

 stompConnector = 
broker.addConnector(stomp+nio://localhost:61612)

This transport use NIO transport underneath and will generally use much less
threads than standard connector. This connector can help if you want to use
large number of queues

I don't know this will help you or not but just give a try

For info please refer this link
http://activemq.apache.org/stomp.html

Cheers!!!
Bharath.R



--
View this message in context: 
http://camel.465427.n5.nabble.com/STOMP-Exception-The-maximum-command-length-was-exceeded-tp5738017p5738019.html
Sent from the Camel - Users mailing list archive at Nabble.com.


Re: STOMP: Exception: The maximum command length was exceeded

2013-08-27 Thread dejanb
Hi, the problem is that you're trying to send stomp messages to openwire
transport connector. Try changing your stomp component to something like

   bean class=org.apache.camel.component.stomp.StompComponent
property name=brokerURL value=tcp://localhost:61623 /
/bean



--
View this message in context: 
http://camel.465427.n5.nabble.com/STOMP-Exception-The-maximum-command-length-was-exceeded-tp5738017p5738023.html
Sent from the Camel - Users mailing list archive at Nabble.com.


Re: Camel RabbitMQ from 2.12 snapshot - missing parameter type:direct

2013-08-27 Thread tushmish
Hi Willem,

Thanks for your quick reply.

Thanks,
Tushar



--
View this message in context: 
http://camel.465427.n5.nabble.com/Camel-RabbitMQ-from-2-12-snapshot-missing-parameter-type-direct-tp5738013p5738026.html
Sent from the Camel - Users mailing list archive at Nabble.com.


Zeromq component

2013-08-27 Thread axelf
Hi.

We want to use zeromq in one of our routes, but we were unable to find its
component (it doesn't exist in maven central repository and the camel extras
downloads link seems to be broken.

How can we use this component?

Regards.

PS: we would like to avoid using maven for this implementation if possible




--
View this message in context: 
http://camel.465427.n5.nabble.com/Zeromq-component-tp5738030.html
Sent from the Camel - Users mailing list archive at Nabble.com.


Re: Zeromq component

2013-08-27 Thread Claus Ibsen
Hi

You can build from the source code at camel-extra. That project is
maintained outside Apache and thus has different release procedures /
schedules / priority / support etc.

There will most likely be a camel-extra release after the Apache Camel
2.12.0 has been released.


On Tue, Aug 27, 2013 at 11:58 AM, axelf cale...@orange.fr wrote:
 Hi.

 We want to use zeromq in one of our routes, but we were unable to find its
 component (it doesn't exist in maven central repository and the camel extras
 downloads link seems to be broken.

 How can we use this component?

 Regards.

 PS: we would like to avoid using maven for this implementation if possible




 --
 View this message in context: 
 http://camel.465427.n5.nabble.com/Zeromq-component-tp5738030.html
 Sent from the Camel - Users mailing list archive at Nabble.com.



-- 
Claus Ibsen
-
Red Hat, Inc.
Email: cib...@redhat.com
Twitter: davsclaus
Blog: http://davsclaus.com
Author of Camel in Action: http://www.manning.com/ibsen


Re: Zeromq component

2013-08-27 Thread axelf
Ok. Thank you very much Claus.



--
View this message in context: 
http://camel.465427.n5.nabble.com/Zeromq-component-tp5738030p5738037.html
Sent from the Camel - Users mailing list archive at Nabble.com.


Re: JaxbDataFormat escaping special characters

2013-08-27 Thread Sven Bauhan

On 08/26/13 16:43, Christian Posta wrote:

At the moment, there is a filtering writer that camel uses by default, and
unfortunately it's not configurable at the moment. If you open a JIRA i
will get a patch for you to make it configurable.

Hey thanks. I will open a ticket in Jira. But I need a solution til the 
end of the week. So I think I have to create an own Dataformat 
definition as workaround now.



Hi,

as JAXB does not escape special characters when marshaling, there exists a
solution to use a special EscapingXMLStreamWriter (see
http://blog.lesc.se/2009/03/**escape-illegal-characters-**
with-jaxb-xml.htmlhttp://blog.lesc.se/2009/03/escape-illegal-characters-with-jaxb-xml.html).
I used this in combination with org.apache.commons.lang.**StringEscapeUtils
to replace the strings.

But I do not know how to replace the XMLStreamWriter used by
JaxbDataFormat with my implementation. Is there a way to tell the
JaxbDataFormat to use my EscapingXMLStreamWriter when marshaling?

The only other solution I could image is to define a Converter for the
data field and call it via the bindings.xjb. But that is just a workaround.

Hmm this does not work. The converted string is escaped then twice with 
the result, that the '' is replaced again by 'amp;'




Re: Stop polling, FTP Component

2013-08-27 Thread kalber
Hi,

i brought my route configuration into the ftp example of camel
(/apache-camel-2.11.1/examples/camel-example-ftp)
and configured out the ftp.properties for testing :

ftp.client=ftp://myserver.xx.com:21/?username=myusernametpassword=mypassword
ftp.server={{ftp.client}}noop=trueinclude=pneus_20130821.csv
--

Launching 'mvn compile exec:java -Pserver' after  download
process is waiting. Manually with contrl-c i can stop process.

How can i programmatically or by configuration stop process ( or better
polling ) ?







--
View this message in context: 
http://camel.465427.n5.nabble.com/Stop-polling-FTP-Component-tp5737925p5738058.html
Sent from the Camel - Users mailing list archive at Nabble.com.


Re: STOMP: Exception: The maximum command length was exceeded

2013-08-27 Thread apara
I tried a number of things:

1) Changing broker configuration to:
final TransportConnector
stompConnector =
broker.addConnector(stomp+nio://0.0.0.0:61623);


2) Changing my Camel wiring to use tcp::61623 instead of
stomp::61623:

bean class=org.apache.camel.component.stomp.StompComponent
property name=brokerURL value=tcp://localhost:61623 /
/bean

3) Changing the route from stomp:queue:dm6 to stomp:queue/dm6:

camel:camelContext
camel:route
camel:from uri=direct:sample/engine/user /
camel:to uri=stomp:queue/dm6 /
/camel:route
/camel:camelContext

And still I get the same exception in each of the above changes.  One thing
to note, I also see a WARN message for unknown data type which I did not
notice before:

06:56:56.841 engine [ActiveMQ Transport: tcp:///127.0.0.1:63277@61613] WARN
 Transport - Transport Connection to: tcp://127.0.0.1:63277 failed:
java.io.IOException: Unknown data type: 69
06:56:56.873 engine [main] ERROR ContextLoader - Context initialization
failed
org.apache.camel.RuntimeCamelException:
org.apache.camel.FailedToCreateRouteException: Failed to create route
route1 at:  To[stomp:queue/dm6]  in route:
Route(route1)[[From[direct:sample/engine/user]] - [To[stomp... because of
Failed to resolve endpoint: stomp://queue/dm6 due to: The maximum command
length was exceeded
at
org.apache.camel.util.ObjectHelper.wrapRuntimeCamelException(ObjectHelper.java:1344)
~[camel-core-2.12-SNAPSHOT.jar:2.12-SNAPSHOT]

I am going to go back to try to send messages via JmsTemplate in Spring to
see if that still works.  Perhaps there was another change that I did which
I don't remember.  If that does not work, I will know there is something
with my configuration.  Perhaps the salad bar of dependencies needs to be
revisited.

If you guys have any other suggestions I can try them out...

Thanks for your help.
-AP_


On Tue, Aug 27, 2013 at 12:49 AM, dejanb [via Camel] 
ml-node+s465427n5738023...@n5.nabble.com wrote:

 Hi, the problem is that you're trying to send stomp messages to openwire
 transport connector. Try changing your stomp component to something like

bean class=org.apache.camel.component.stomp.StompComponent
 property name=brokerURL value=tcp://localhost:61623 /
 /bean

 --
  If you reply to this email, your message will be added to the discussion
 below:

 http://camel.465427.n5.nabble.com/STOMP-Exception-The-maximum-command-length-was-exceeded-tp5738017p5738023.html
  To unsubscribe from STOMP: Exception: The maximum command length was
 exceeded, click 
 herehttp://camel.465427.n5.nabble.com/template/NamlServlet.jtp?macro=unsubscribe_by_codenode=5738017code=YXBhcmFAc3RhbmRhcmRzZXQuY29tfDU3MzgwMTd8LTU0MjY3MDkwOQ==
 .
 NAMLhttp://camel.465427.n5.nabble.com/template/NamlServlet.jtp?macro=macro_viewerid=instant_html%21nabble%3Aemail.namlbase=nabble.naml.namespaces.BasicNamespace-nabble.view.web.template.NabbleNamespace-nabble.view.web.template.NodeNamespacebreadcrumbs=notify_subscribers%21nabble%3Aemail.naml-instant_emails%21nabble%3Aemail.naml-send_instant_email%21nabble%3Aemail.naml





--
View this message in context: 
http://camel.465427.n5.nabble.com/STOMP-Exception-The-maximum-command-length-was-exceeded-tp5738017p5738059.html
Sent from the Camel - Users mailing list archive at Nabble.com.

Cannot poll windows absolute path using FTP component

2013-08-27 Thread Alberto Brosich


Hi,

I'm trying to poll an absolute path on a windows machine, with sftp 
component (Windows machine has openssh server installed).
Using scp from command line works all fine, with unix separators 
(c:/dir1/dir2/filename).
Using ftp component I got always the following error: Cannot change 
directory to: c:.
I tried every combination of separators and separator attribute (but 
it should work only for uploading, doc says).

I haven't found nothing useful in camel or jsch documentation.
I'm using camel 2.11.1.

Anyone already experienced this problem?

Best regards

Alberto


Re: Stop polling, FTP Component

2013-08-27 Thread Claus Ibsen
Hi

Ah okay this is expected as the Camel route will keep polling for new
files. You can configure how often it should do that etc.

There is many ways stop Camel or routes. Check out the docs and search
this forum as its been discussed in the past.

And check the FAQ etc also.


On Tue, Aug 27, 2013 at 4:03 PM, kalber karlheinz.al...@swslt.com wrote:
 Hi,

 i brought my route configuration into the ftp example of camel
 (/apache-camel-2.11.1/examples/camel-example-ftp)
 and configured out the ftp.properties for testing :

 ftp.client=ftp://myserver.xx.com:21/?username=myusernametpassword=mypassword
 ftp.server={{ftp.client}}noop=trueinclude=pneus_20130821.csv
 --

 Launching 'mvn compile exec:java -Pserver' after  download
 process is waiting. Manually with contrl-c i can stop process.

 How can i programmatically or by configuration stop process ( or better
 polling ) ?







 --
 View this message in context: 
 http://camel.465427.n5.nabble.com/Stop-polling-FTP-Component-tp5737925p5738058.html
 Sent from the Camel - Users mailing list archive at Nabble.com.



-- 
Claus Ibsen
-
Red Hat, Inc.
Email: cib...@redhat.com
Twitter: davsclaus
Blog: http://davsclaus.com
Author of Camel in Action: http://www.manning.com/ibsen


Re: JAAS auth + Jetty - Exception

2013-08-27 Thread Claus Ibsen
Hi

This is the wrong mailing list / forum to ask this kind of question.

You are using Fuse ESB so you can use their forum
http://fusesource.com/forums/index.jspa

Or your question is much more related to ServiceMix / Karaf.


And your problem seems related to your bundle not importing this
package: org.eclipse.jetty.http.security

You would need to add that to your bundle.

On Tue, Aug 27, 2013 at 5:18 PM, contactreji contactr...@gmail.com wrote:
 Hi friends

 I was just trying to implement BASIC JAAS authentication referring the
 online guide at
 https://access.redhat.com/site/documentation/en-US/JBoss_Fuse/6.0/html/Security_Guide/files/CamelJetty-BasicAuth.html

 I have followed the exact steps illustrated in the guide. But while
 deployment I get the error as follows and deployment fails.

 Could you  help me with this stuff pleasee!

 *18:12:49,709 | WARN  | qtp618140013-986 | /
 | 90 - org.eclipse.jetty.util - 7.6.7.v20120910 | %bundles.pluginTitle:
 Cannot start
 org.osgi.framework.BundleException: Unresolved constraint in bundle
 com.outotec.mes-bw-copper_recovery_perc_ssl [450]: Unable to resolve 450.1:
 missing requirement [450.1] osgi.wiring.package;
 ((osgi.wiring.package=org.eclipse.jetty.http.security)(version=7.5.0)(!(version=8.0.0)))
 at 
 org.apache.felix.framework.Felix.resolveBundleRevision(Felix.java:4054)
 at org.apache.felix.framework.Felix.startBundle(Felix.java:1959)
 at org.apache.felix.framework.BundleImpl.start(BundleImpl.java:947)
 at org.apache.felix.framework.BundleImpl.start(BundleImpl.java:934)
 at
 org.apache.felix.webconsole.internal.core.BundlesServlet.doPost(BundlesServlet.java:312)[294:org.apache.karaf.webconsole.console:2.3.0.fuse-71-047]
 at
 javax.servlet.http.HttpServlet.service(HttpServlet.java:713)[95:org.apache.geronimo.specs.geronimo-servlet_2.5_spec:1.1.2]
 at
 javax.servlet.http.HttpServlet.service(HttpServlet.java:806)[95:org.apache.geronimo.specs.geronimo-servlet_2.5_spec:1.1.2]
 at
 org.apache.felix.webconsole.internal.servlet.OsgiManager.service(OsgiManager.java:520)[294:org.apache.karaf.webconsole.console:2.3.0.fuse-71-047]
 at
 org.apache.felix.webconsole.internal.servlet.OsgiManager.service(OsgiManager.java:445)[294:org.apache.karaf.webconsole.console:2.3.0.fuse-71-047]
 at
 org.apache.felix.webconsole.internal.KarafOsgiManager.doService(KarafOsgiManager.java:74)[294:org.apache.karaf.webconsole.console:2.3.0.fuse-71-047]
 at
 org.apache.felix.webconsole.internal.KarafOsgiManager$1.run(KarafOsgiManager.java:54)[294:org.apache.karaf.webconsole.console:2.3.0.fuse-71-047]
 at java.security.AccessController.doPrivileged(Native 
 Method)[:1.6.0_45]
 at
 org.apache.karaf.jaas.modules.JaasHelper.doAs(JaasHelper.java:67)[43:org.apache.karaf.jaas.modules:2.3.0.fuse-71-047]
 at
 org.apache.felix.webconsole.internal.KarafOsgiManager.service(KarafOsgiManager.java:52)[294:org.apache.karaf.webconsole.console:2.3.0.fuse-71-047]
 at sun.reflect.GeneratedMethodAccessor76.invoke(Unknown Source)
 at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown
 Source)[:1.6.0_45]
 at java.lang.reflect.Method.invoke(Unknown Source)[:1.6.0_45]
 at
 org.ops4j.pax.web.service.internal.HttpServiceStarted$1.invoke(HttpServiceStarted.java:182)[100:org.ops4j.pax.web.pax-web-runtime:1.1.9]
 at org.ops4j.pax.web.service.internal.$Proxy27.service(Unknown
 Source)[100:org.ops4j.pax.web.pax-web-runtime:1.1.9]
 at
 org.eclipse.jetty.servlet.ServletHolder.handle(ServletHolder.java:652)[80:org.eclipse.jetty.servlet:7.6.7.v20120910]
 at
 org.eclipse.jetty.servlet.ServletHandler.doHandle(ServletHandler.java:447)[80:org.eclipse.jetty.servlet:7.6.7.v20120910]
 at
 org.ops4j.pax.web.service.jetty.internal.HttpServiceServletHandler.doHandle(HttpServiceServletHandler.java:70)[98:org.ops4j.pax.web.pax-web-jetty:1.1.9]
 at
 org.eclipse.jetty.server.handler.ScopedHandler.handle(ScopedHandler.java:137)[84:org.eclipse.jetty.server:7.6.7.v20120910]
 at
 org.eclipse.jetty.security.SecurityHandler.handle(SecurityHandler.java:534)[82:org.eclipse.jetty.security:7.6.7.v20120910]
 at
 org.eclipse.jetty.server.session.SessionHandler.doHandle(SessionHandler.java:227)[84:org.eclipse.jetty.server:7.6.7.v20120910]
 at
 org.eclipse.jetty.server.handler.ContextHandler.doHandle(ContextHandler.java:1038)[84:org.eclipse.jetty.server:7.6.7.v20120910]
 at
 org.ops4j.pax.web.service.jetty.internal.HttpServiceContext.doHandle(HttpServiceContext.java:117)[98:org.ops4j.pax.web.pax-web-jetty:1.1.9]
 at
 org.eclipse.jetty.servlet.ServletHandler.doScope(ServletHandler.java:374)[80:org.eclipse.jetty.servlet:7.6.7.v20120910]
 at
 org.eclipse.jetty.server.session.SessionHandler.doScope(SessionHandler.java:189)[84:org.eclipse.jetty.server:7.6.7.v20120910]
 at
 

Xpath parameter binding NodeList vs. Node

2013-08-27 Thread ychawla
Hello All,
I am using Camel Xpath parameter binding.  I have a method that has an
expression like this for example:

public void process(Exchange exchange,
@OJBCamelXPath(/foo:Container) NodeList 
containerNodeList) throws
Exception

I know that the Xpath will only return a single node, however, I need to
bind to  the parameter NodeList or else I get this exception:

camel  No type converter available to convert from type:
org.apache.xml.dtm.ref.DTMNodeList to the required type: org.w3c.dom.Node

I saw this Camel issue that was resolved:

https://issues.apache.org/jira/browse/CAMEL-5403

This suggests that there is a type converter to go from a NodeList of size 1
to a Node.  I am using Camel 2.10.3 so I should have this typeconverter.

Is this typeconverter used with parameter binding or only in the Xpath in
the DSL?

Thanks,
Yogesh



--
View this message in context: 
http://camel.465427.n5.nabble.com/Xpath-parameter-binding-NodeList-vs-Node-tp5738067.html
Sent from the Camel - Users mailing list archive at Nabble.com.


Re: Xpath parameter binding NodeList vs. Node

2013-08-27 Thread Raul Kripalani
I wonder if your XPath is returning zero nodes. Try to find out the length
of the NodeList with the getLength method.

What exactly is this @OJBCamelXPath annotation? And how does it recognise
namespace foo? You don't seem to declare it (unless the custom annotation
is taking care of it somehow - an extension of the standard XPath?).

Please paste the source of @OJBCamelXPath and a sample input XML document.

Thanks,

*Raúl Kripalani*
Apache Camel PMC Member  Committer | Enterprise Architect, Open Source
Integration specialist
http://about.me/raulkripalani | http://www.linkedin.com/in/raulkripalani
http://blog.raulkr.net | twitter: @raulvk

On Tue, Aug 27, 2013 at 4:40 PM, ychawla premiergenerat...@yahoo.comwrote:

 Hello All,
 I am using Camel Xpath parameter binding.  I have a method that has an
 expression like this for example:

 public void process(Exchange exchange,
 @OJBCamelXPath(/foo:Container) NodeList
 containerNodeList) throws
 Exception

 I know that the Xpath will only return a single node, however, I need to
 bind to  the parameter NodeList or else I get this exception:

 camel  No type converter available to convert from type:
 org.apache.xml.dtm.ref.DTMNodeList to the required type: org.w3c.dom.Node

 I saw this Camel issue that was resolved:

 https://issues.apache.org/jira/browse/CAMEL-5403

 This suggests that there is a type converter to go from a NodeList of size
 1
 to a Node.  I am using Camel 2.10.3 so I should have this typeconverter.

 Is this typeconverter used with parameter binding or only in the Xpath in
 the DSL?

 Thanks,
 Yogesh



 --
 View this message in context:
 http://camel.465427.n5.nabble.com/Xpath-parameter-binding-NodeList-vs-Node-tp5738067.html
 Sent from the Camel - Users mailing list archive at Nabble.com.



Re: Xpath parameter binding NodeList vs. Node

2013-08-27 Thread ychawla
Hi Raul,
Thanks for you reply.  The query returns exactly one node. To retrieve the
node, I do something like this:

Node containerNode = containerNodeList.item(0);

The OJBCamelXpath annotation is a class like this:

@Retention(RetentionPolicy.RUNTIME)
@Target({ElementType.FIELD, ElementType.METHOD, ElementType.PARAMETER})
@LanguageAnnotation(language = xpath, factory =
XPathAnnotationExpressionFactory.class)
public @interface OJBCamelXpath {
String value();

// You can add the namespaces as the default value of the annotation
NamespacePrefix[] namespaces() default {
@NamespacePrefix(prefix = foo, uri = http://someNamespace/1.0;)
};

Class? resultType() default NodeList.class;
}

It allows you to do an Xpath bean parameter binding.  It allows for Xpath
injection as described on this page:

http://camel.apache.org/xpath.html

Thanks!

Yogesh



--
View this message in context: 
http://camel.465427.n5.nabble.com/Xpath-parameter-binding-NodeList-vs-Node-tp5738067p5738072.html
Sent from the Camel - Users mailing list archive at Nabble.com.


Camel service start/stop

2013-08-27 Thread kiranreddykasa
Hi i would like to know how to use the following class

http://camel.apache.org/maven/current/camel-core/apidocs/org/apache/camel/support/ServiceSupport.html

how can I make my custom class so that it is managed by camel ??



-
Regards

kiran Reddy
--
View this message in context: 
http://camel.465427.n5.nabble.com/Camel-service-start-stop-tp5738073.html
Sent from the Camel - Users mailing list archive at Nabble.com.


Re: Camel service start/stop

2013-08-27 Thread Christian Posta
So that class implements the boiler plate code for lifecycle management
(start, stop, suspend, resume, isStarting, isStopping, etc).

If you want to have one of your custom classes managed by camel, you can
register it as a service by Implementing Service.java (or extending
ServiceSupport) and calling CamelContext#addService()...

You could also plug into the lifecycle by implementing
http://camel.apache.org/maven/current/camel-core/apidocs/org/apache/camel/spi/LifecycleStrategy.htmland
registering with CamelContext#addLifecycleStrategy




On Tue, Aug 27, 2013 at 12:28 PM, kiranreddykasa kirankuma...@fss.co.inwrote:

 Hi i would like to know how to use the following class


 http://camel.apache.org/maven/current/camel-core/apidocs/org/apache/camel/support/ServiceSupport.html

 how can I make my custom class so that it is managed by camel ??



 -
 Regards

 kiran Reddy
 --
 View this message in context:
 http://camel.465427.n5.nabble.com/Camel-service-start-stop-tp5738073.html
 Sent from the Camel - Users mailing list archive at Nabble.com.




-- 
*Christian Posta*
http://www.christianposta.com/blog
twitter: @christianposta


Re: String to Endpoint

2013-08-27 Thread Jose Espinosa
Thanks Tracy!! This is what I'm looking for.

Jose

On Fri, Aug 23, 2013 at 12:27 PM, Tracy Snell tsn...@gmail.com wrote:
 Set the header:

 Exchange.HTTP_URI   String  URI to call. Will override existing URI set 
 directly on the endpoint.

 http://camel.apache.org/http4.html

 As the above says, that'll override whatever address is in the .to. So 
 .to(http4://nowhere.com) will be replaced by Exchange.HTTP_URI if it exists.

 On Aug 23, 2013, at 1:03 PM, Jose Espinosa j...@revinate.com wrote:

 They are http endpoints.  Headers will definitely do the job but I
 haven't find a way to do it.

 On Thu, Aug 22, 2013 at 5:37 PM, Christian Posta
 christian.po...@gmail.com wrote:
 What endpoint will you use to fetch the webpage? Might be able to use
 headers...

 On Thursday, August 22, 2013, Jose Espinosa wrote:

 Hi,


 I am writing a route that needs to fetch data from a webpage, the
 source webpage depends of the input message.  My current
 implementation uses dynamicRouter but the need of track multiple
 calls (I just need to go to fetch the data once) is a big turn off.


 Is there a way to make dynamic routes without using dynamicRouter?
 Or a way to dynamically transform a single value to an endpoint?


 Thanks,

 Jose Espinosa



 --
 *Christian Posta*
 http://www.christianposta.com/blog
 twitter: @christianposta



Re: STOMP: Exception: The maximum command length was exceeded

2013-08-27 Thread apara
Most of the day in meetings today, I did not have a chance to put together
an isolated example.  What I did manage to do re-connect a Spring
JmsTemplate implementation back into my code.  The JmsTemplate
implementation seems to work fine.

Here is how its wired:

bean id=jmsStompConnectionFactory
class=org.fusesource.stomp.jms.StompJmsConnectionFactory
property name=brokerURI value=tcp://localhost:61623 /
/bean

bean id=jmsStompTemplate
class=org.springframework.jms.core.JmsTemplate
property name=connectionFactory ref=jmsStompConnectionFactory
/
property name=pubSubDomain value=true /
/bean

In my class:

   @Resource(name=jmsStompTemplate)
private JmsTemplate
jmsTemplate;

...

//Send a stomp message on its way
//
jmsTemplate.send(
//Create a specifically stop destination, regular
destination will not do
//
new StompJmsDestination(
getTopicName(userId)
),

//Message creator to create a stomp message
//
new MessageCreator() {
@Override
public Message createMessage(final Session session)
throws JMSException {
return
session.createTextMessage(messageText);
}
}
);

So, the above appears to work talking to Broker's at tcp://localhost:61623,
recall my broker's configuration is:

final BrokerService
broker =
new BrokerService();

//Create the network connector
//
final TransportConnector
stompConnector =
broker.addConnector(stomp+nio://0.0.0.0:61623);


So, the issue does not appear to be on the Broker's side but rather on the
sending side.  Still working on figuring out what the difference is.  By
the way, does anyone know where the code for camel-stomp is, specifically
version 2.12-SNAPSHOT ?

Thanks.
-AP_


On Tue, Aug 27, 2013 at 7:46 AM, Dejan Bosanac [via Camel] 
ml-node+s465427n5738064...@n5.nabble.com wrote:

 Coupe more things to try.

 1. Use 61613 for the stomp transport in the broker configuration

 2. Use stomp endpoint like camel:to
 uri=stomp:queue:dm6?brokerUrl=tcp://localhost:61623 / (use the same
 port you configure in the broker)

 If all fails, it's best to create a test case that demonstrate your
 problem, so we can examine it further.

 Regards
 --
 Dejan Bosanac
 --
 Red Hat, Inc.
 FuseSource is now part of Red Hat
 [hidden email] http://user/SendEmail.jtp?type=nodenode=5738064i=0
 Twitter: @dejanb
 Blog: http://sensatic.net
 ActiveMQ in Action: http://www.manning.com/snyder/

 On Tue, Aug 27, 2013 at 4:07 PM, apara [hidden 
 email]http://user/SendEmail.jtp?type=nodenode=5738064i=1
 wrote:

  I tried a number of things:
 
  1) Changing broker configuration to:
  final TransportConnector
  stompConnector =
  broker.addConnector(stomp+nio://0.0.0.0:61623);
 
 
  2) Changing my Camel wiring to use tcp::61623 instead of
  stomp::61623:
 
  bean class=org.apache.camel.component.stomp.StompComponent
  property name=brokerURL value=tcp://localhost:61623 /
  /bean
 
  3) Changing the route from stomp:queue:dm6 to stomp:queue/dm6:
 
  camel:camelContext
  camel:route
  camel:from uri=direct:sample/engine/user /
  camel:to uri=stomp:queue/dm6 /
  /camel:route
  /camel:camelContext
 
  And still I get the same exception in each of the above changes.  One
 thing
  to note, I also see a WARN message for unknown data type which I did not
  notice before:
 
  06:56:56.841 engine [ActiveMQ Transport: tcp:///127.0.0.1:63277@61613]
 WARN
   Transport - Transport Connection to: tcp://127.0.0.1:63277 failed:
  java.io.IOException: Unknown data type: 69
  06:56:56.873 engine [main] ERROR ContextLoader - Context initialization
  failed
  org.apache.camel.RuntimeCamelException:
  org.apache.camel.FailedToCreateRouteException: Failed to create route
  route1 at:  To[stomp:queue/dm6]  in route:
  Route(route1)[[From[direct:sample/engine/user]] - [To[stomp... because
 of
  Failed to resolve endpoint: stomp://queue/dm6 due to: The maximum
 command
  length was exceeded
  at
 
 org.apache.camel.util.ObjectHelper.wrapRuntimeCamelException(ObjectHelper.java:1344)

  ~[camel-core-2.12-SNAPSHOT.jar:2.12-SNAPSHOT]
 
  I am going to go back to try to send messages via JmsTemplate in Spring
 to
  see if that still works.  Perhaps there was another change that I did
 which
  I don't remember.  If that does not work, I will know there is something
  with my configuration.  Perhaps the salad bar of dependencies needs to
 be
  revisited.
 
  If you guys have any other suggestions I can try them out...
 
  Thanks for your help.
  -AP_
 
 
  On Tue, Aug 27, 2013 

Re: throttling a restlet endpoint by discarding excess requests

2013-08-27 Thread Christian Posta
I guess the answer to this question depends on what Restlet framework has
built in to do that.
I just looked at the code for Restlet, and it appears to use an unbounded
ConcurrentLinkedQueue to handle incoming requests. I didn't see anything
obvious for how to throttle the requests: however, I bet it's extensible in
some way for you to write in a custom handler/throttler... though that
might be a good question for the Restlet community.

I think if you used the Throttler in Camel, it would at least slow down the
work that the Restlet threads can do (and maybe even give back 503...),
though you'd have to try it out yourself to see how much it would throttle.

You may wish to take a look at a different (jetty? or cxf-rs?) component
that depends on a container where you might be able to more easily control
that backlog of requests over the http connectors.


On Tue, Aug 27, 2013 at 6:55 PM, osupit ollie.su...@gmail.com wrote:

 Hi

 I have a set of routes that looks like this:

 

 route id=getcustomer
 from
 uri=restlet:http://
 {{fpRestHost}}:{{fpRestPort}}/greenfield/customer/getcustomer/{customerId}?restletMethod=GET
 /
 to
 uri=bean:customCustomerService?method=getCustomer/
 /route

 

 In my bean customCustomerService I call a backend service that needs to
 be
 protected as it falls over under load.

 The requirement is that excess incoming requests need to be discarded
 (returned an appropriate a HTTP status code eg  503 unavailable
 immediately).

 So for example if only 10 requests can be processed concurrently, any
 (HTTP)
 requests that come in while those ten slots are being processed  need
 return
 to immediately to the caller.

 I've looked at the Throttler EIP and the ThrottlingInflightRoutePolicy
 routepolicy but these seem to just block/wait or queue excess requests to
 be
 serviced when the protected resource is ready again.

 Is there an alternative throttling technique which allows me to discard
 requests as described above?



 --
 View this message in context:
 http://camel.465427.n5.nabble.com/throttling-a-restlet-endpoint-by-discarding-excess-requests-tp5738089.html
 Sent from the Camel - Users mailing list archive at Nabble.com.




-- 
*Christian Posta*
http://www.christianposta.com/blog
twitter: @christianposta


Re: STOMP: Exception: The maximum command length was exceeded

2013-08-27 Thread apara
Just tried the options you proposed:

Seeing this exception instead:

org.apache.camel.ResolveEndpointFailedException: Failed to resolve
endpoint: stomp://queue:dm6?brokerURL=tcp%3A%2F%2Flocalhost%3A61623 due to:
There are 1 parameters that couldn't be set on the endpoint. Check the uri
if the parameters are spelt correctly and that they are properties of the
endpoint. Unknown parameters=[{brokerURL=tcp://localhost:61623}]
at
org.apache.camel.impl.DefaultComponent.validateParameters(DefaultComponent.java:189)
at
org.apache.camel.impl.DefaultComponent.createEndpoint(DefaultComponent.java:134)
at
org.apache.camel.impl.DefaultCamelContext.getEndpoint(DefaultCamelContext.java:508)
at
org.apache.camel.util.CamelContextHelper.getMandatoryEndpoint(CamelContextHelper.java:63)
at
org.apache.camel.model.RouteDefinition.resolveEndpoint(RouteDefinition.java:192)
at
org.apache.camel.impl.DefaultRouteContext.resolveEndpoint(DefaultRouteContext.java:106)
at
org.apache.camel.impl.DefaultRouteContext.resolveEndpoint(DefaultRouteContext.java:112)
at
org.apache.camel.model.SendDefinition.resolveEndpoint(SendDefinition.java:61)
at
org.apache.camel.model.SendDefinition.createProcessor(SendDefinition.java:55)
at
org.apache.camel.model.ProcessorDefinition.makeProcessor(ProcessorDefinition.java:500)
at
org.apache.camel.model.ProcessorDefinition.addRoutes(ProcessorDefinition.java:213)
at
org.apache.camel.model.RouteDefinition.addRoutes(RouteDefinition.java:909)
at
org.apache.camel.model.RouteDefinition.addRoutes(RouteDefinition.java:177)
at
org.apache.camel.impl.DefaultCamelContext.startRoute(DefaultCamelContext.java:770)
at
org.apache.camel.impl.DefaultCamelContext.startRouteDefinitions(DefaultCamelContext.java:1914)
at
org.apache.camel.impl.DefaultCamelContext.doStartCamel(DefaultCamelContext.java:1670)
at
org.apache.camel.impl.DefaultCamelContext.doStart(DefaultCamelContext.java:1544)
at
org.apache.camel.spring.SpringCamelContext.doStart(SpringCamelContext.java:179)
at org.apache.camel.support.ServiceSupport.start(ServiceSupport.java:61)
at
org.apache.camel.impl.DefaultCamelContext.start(DefaultCamelContext.java:1512)
at
org.apache.camel.spring.SpringCamelContext.maybeStart(SpringCamelContext.java:228)
at
org.apache.camel.spring.SpringCamelContext.onApplicationEvent(SpringCamelContext.java:118)
at
org.apache.camel.spring.CamelContextFactoryBean.onApplicationEvent(CamelContextFactoryBean.java:301)
at
org.springframework.context.event.SimpleApplicationEventMulticaster.multicastEvent(SimpleApplicationEventMulticaster.java:97)
at
org.springframework.context.support.AbstractApplicationContext.publishEvent(AbstractApplicat

Due to this:

protected void validateParameters(String uri, MapString, Object
parameters, String optionPrefix) {
MapString, Object param = parameters;
if (optionPrefix != null) {
param = IntrospectionSupport.extractProperties(parameters,
optionPrefix);
}

if (param.size()  0) {
throw new ResolveEndpointFailedException(uri, There are  +
param.size()
+  parameters that couldn't be set on the endpoint.
+  Check the uri if the parameters are spelt correctly and
that they are properties of the endpoint.
+  Unknown parameters=[ + param + ]);
}
}

-AP_


On Tue, Aug 27, 2013 at 7:46 AM, Dejan Bosanac [via Camel] 
ml-node+s465427n5738064...@n5.nabble.com wrote:

 Coupe more things to try.

 1. Use 61613 for the stomp transport in the broker configuration

 2. Use stomp endpoint like camel:to
 uri=stomp:queue:dm6?brokerUrl=tcp://localhost:61623 / (use the same
 port you configure in the broker)

 If all fails, it's best to create a test case that demonstrate your
 problem, so we can examine it further.

 Regards
 --
 Dejan Bosanac
 --
 Red Hat, Inc.
 FuseSource is now part of Red Hat
 [hidden email] http://user/SendEmail.jtp?type=nodenode=5738064i=0
 Twitter: @dejanb
 Blog: http://sensatic.net
 ActiveMQ in Action: http://www.manning.com/snyder/

 On Tue, Aug 27, 2013 at 4:07 PM, apara [hidden 
 email]http://user/SendEmail.jtp?type=nodenode=5738064i=1
 wrote:

  I tried a number of things:
 
  1) Changing broker configuration to:
  final TransportConnector
  stompConnector =
  broker.addConnector(stomp+nio://0.0.0.0:61623);
 
 
  2) Changing my Camel wiring to use tcp::61623 instead of
  stomp::61623:
 
  bean class=org.apache.camel.component.stomp.StompComponent
  property name=brokerURL value=tcp://localhost:61623 /
  /bean
 
  3) Changing the route from stomp:queue:dm6 to stomp:queue/dm6:
 
  camel:camelContext
  camel:route
  camel:from uri=direct:sample/engine/user /
  camel:to uri=stomp:queue/dm6 /
  /camel:route
  /camel:camelContext
 
  And still I get the same exception in each of the above changes.  One
 thing
  to note, I also see a WARN message for unknown data type 

Re: throttling a restlet endpoint by discarding excess requests

2013-08-27 Thread osupit
Very much appreciate the quick response and insights. 

Unfortunately the requirement is as originally stated - I need to discard
excess load by returning excess requests to the caller - so the Throttler
option doesn't work for me.

I'll have a poke around the Restlet docs/community and see if this has been
come up before.  




--
View this message in context: 
http://camel.465427.n5.nabble.com/throttling-a-restlet-endpoint-by-discarding-excess-requests-tp5738089p5738099.html
Sent from the Camel - Users mailing list archive at Nabble.com.


Re: freemarker with pojo and/or xpath

2013-08-27 Thread Christian Posta
Yep, totally possible.
So freemarker binds a context to the template, and populates the template
body with whatever is found in the context
So in the case of Camel integration, Camel will put some parts of the
exchange (and the whole exchange actually) which is then available in the
freemarker template.
The body and headers are all treated as POJOs when they are bound to the
freemarker context, so if you have your own pojo, MyPerson, and you wish
you access its members 'givenName' or 'familyName' within the freemarker
template, you can do so like ${body.givenName} or ${body.familyName}. Same
thing goes for headers.

Have a peek at this unit test to make it more clear:

https://github.com/apache/camel/blob/master/components/camel-freemarker/src/test/java/org/apache/camel/component/freemarker/FreemarkerBodyAsDomainObjectTest.java#L32


On Tue, Aug 27, 2013 at 8:44 PM, paulc8712 paulc8...@gmail.com wrote:

 Hi All.

 I'm fairly new to Camel - and very new to Freemarker.

 There doesn't seem to be much out there in the way of camel-freemarker
 examples other than the fairly simplistic email example in
 http://camel.apache.org/freemarker.html

 What I would like to be able to do is use freemarker with either a POJO
 header or body, or XML using xpath.  Is this possible?

 If it is - I would appreciate it greatly if people could share some sample
 freemarker templates that use POJO as the data source.

 Thanks, Paulc



 --
 View this message in context:
 http://camel.465427.n5.nabble.com/freemarker-with-pojo-and-or-xpath-tp5738098.html
 Sent from the Camel - Users mailing list archive at Nabble.com.




-- 
*Christian Posta*
http://www.christianposta.com/blog
twitter: @christianposta


Re: throttling a restlet endpoint by discarding excess requests

2013-08-27 Thread Christian Posta
Well, another thing you could look into is using a custom
ScheduledThreadPoolExecutor for the throttler. You could use a
BlockingQueue with a specific size (10 in your case), and any others that
tried to get scheduled would through an exception. Then in the throttler
config you would set 'callerRunsWhenRejected' == false so that an exception
is thrown.

Take a look here for setting your own custom queue for the
ScheduledThreadPoolExecutor:
http://stackoverflow.com/questions/13514441/scheduledthreadpoolexecutors-and-custom-queue

And take a look here for setting custom executor service for the throttler:
http://camel.apache.org/threading-model.html

HTH


On Tue, Aug 27, 2013 at 8:53 PM, osupit ollie.su...@gmail.com wrote:

 Very much appreciate the quick response and insights.

 Unfortunately the requirement is as originally stated - I need to discard
 excess load by returning excess requests to the caller - so the Throttler
 option doesn't work for me.

 I'll have a poke around the Restlet docs/community and see if this has been
 come up before.




 --
 View this message in context:
 http://camel.465427.n5.nabble.com/throttling-a-restlet-endpoint-by-discarding-excess-requests-tp5738089p5738099.html
 Sent from the Camel - Users mailing list archive at Nabble.com.




-- 
*Christian Posta*
http://www.christianposta.com/blog
twitter: @christianposta


AW: freemarker with pojo and/or xpath

2013-08-27 Thread jhm
For Freemarker itself the manual is on http://freemarker.org/docs/

Jan

 -Ursprüngliche Nachricht-
 Von: Christian Posta [mailto:christian.po...@gmail.com]
 Gesendet: Mittwoch, 28. August 2013 06:01
 An: users@camel.apache.org
 Betreff: Re: freemarker with pojo and/or xpath
 
 Yep, totally possible.
 So freemarker binds a context to the template, and populates the
 template body with whatever is found in the context
 So in the case of Camel integration, Camel will put some parts of the
 exchange (and the whole exchange actually) which is then available in
 the freemarker template.
 The body and headers are all treated as POJOs when they are bound to
 the freemarker context, so if you have your own pojo, MyPerson, and you
 wish you access its members 'givenName' or 'familyName' within the
 freemarker template, you can do so like ${body.givenName} or
 ${body.familyName}. Same thing goes for headers.
 
 Have a peek at this unit test to make it more clear:
 
 https://github.com/apache/camel/blob/master/components/camel-
 freemarker/src/test/java/org/apache/camel/component/freemarker/Freemark
 erBodyAsDomainObjectTest.java#L32
 
 
 On Tue, Aug 27, 2013 at 8:44 PM, paulc8712 paulc8...@gmail.com wrote:
 
  Hi All.
 
  I'm fairly new to Camel - and very new to Freemarker.
 
  There doesn't seem to be much out there in the way of camel-
 freemarker
  examples other than the fairly simplistic email example in
  http://camel.apache.org/freemarker.html
 
  What I would like to be able to do is use freemarker with either a
  POJO header or body, or XML using xpath.  Is this possible?
 
  If it is - I would appreciate it greatly if people could share some
  sample freemarker templates that use POJO as the data source.
 
  Thanks, Paulc
 
 
 
  --
  View this message in context:
  http://camel.465427.n5.nabble.com/freemarker-with-pojo-and-or-xpath-
 tp
  5738098.html Sent from the Camel - Users mailing list archive at
  Nabble.com.
 
 
 
 
 --
 *Christian Posta*
 http://www.christianposta.com/blog
 twitter: @christianposta



Re: Camel service start/stop

2013-08-27 Thread kiranreddykasa
Hi I have created a class by extending ServiceSupport.

And I'm staring my program with the following code.

  public static void main(String... args) throws Exception {
AbstractApplicationContext applicationContext = new
ClassPathXmlApplicationContext(

classpath:/META-INF/spring/camel-context*.xml);
Main main = new Main();
main.setApplicationContext(applicationContext);
main.enableHangupSupport();
main.addRouteBuilder(new CustomeRouteBuilder());
main.run(args);

}

I'm not sure how to register service here.
Can I add it in applicationcontext file ?



-
Regards

kiran Reddy
--
View this message in context: 
http://camel.465427.n5.nabble.com/Camel-service-start-stop-tp5738073p5738109.html
Sent from the Camel - Users mailing list archive at Nabble.com.


Re: IntelliJ plugin for Camel / Blueprint / Karaf

2013-08-27 Thread AlanFoster
No problem! If you run into problems or have any ideas, be sure to create an
issue on Github :)



--
View this message in context: 
http://camel.465427.n5.nabble.com/IntelliJ-plugin-for-Camel-Blueprint-Karaf-tp5737966p5738068.html
Sent from the Camel - Users mailing list archive at Nabble.com.


Re: JAAS auth + Jetty - Exception

2013-08-27 Thread contactreji
Hi Claus

I added the dependency. Please find my POM below
?xml version=1.0 encoding=UTF-8 standalone=no?
project xmlns=http://maven.apache.org/POM/4.0.0;
xmlns:xsi=http://www.w3.org/2001/XMLSchema-instance;
xsi:schemaLocation=http://maven.apache.org/POM/4.0.0
http://maven.apache.org/maven-v4_0_0.xsd;

modelVersion4.0.0/modelVersion



version1.0.0/version
groupIdcom.outotec/groupId
artifactIdmes-bw-copper_recovery_perc_ssl/artifactId
nameCopper_Recovery_Percentage_Ssl/name
descriptionCreates a web service using the WSDL contract
first/description
packagingbundle/packaging


repositories
repository
idfusesource/id
nameFuseSource Release Repository/name

urlhttp://repo.fusesource.com/nexus/content/groups/public//url
snapshots
enabledfalse/enabled
/snapshots
releases
enabledtrue/enabled
/releases
/repository
repository
idfusesource.ea/id
nameFuseSource Community Early Access Release 
Repository/name

urlhttp://repo.fusesource.com/nexus/content/groups/ea/url
snapshots
enabledfalse/enabled
/snapshots
releases
enabledtrue/enabled
/releases
/repository
repository
idjboss-public-repository-group/id
nameJBoss Public Repository Group/name

urlhttp://repository.jboss.org/nexus/content/groups/public//url
layoutdefault/layout
releases
enabledtrue/enabled
updatePolicynever/updatePolicy
/releases
snapshots
enabledtrue/enabled
updatePolicydaily/updatePolicy
/snapshots
/repository











/repositories

pluginRepositories
pluginRepository
idfusesource/id
nameFuseSource Release Repository/name

urlhttp://repo.fusesource.com/nexus/content/groups/public//url
snapshots
enabledfalse/enabled
/snapshots
releases
enabledtrue/enabled
/releases
/pluginRepository
pluginRepository
idfusesource.ea/id
nameFuseSource Community Early Access Release 
Repository/name

urlhttp://repo.fusesource.com/nexus/content/groups/ea/url
snapshots
enabledfalse/enabled
/snapshots
releases
enabledtrue/enabled
/releases
/pluginRepository
/pluginRepositories


dependencies

dependency
groupIdorg.apache.camel/groupId
artifactIdcamel-core/artifactId
version2.10.0.fuse-71-047/version
/dependency

dependency
groupIdorg.apache.camel/groupId
artifactIdcamel-cxf/artifactId
version2.10.0.fuse-71-047/version
/dependency

dependency
groupIdlog4j/groupId
artifactIdlog4j/artifactId
version1.2.16/version
/dependency


dependency
groupIdorg.slf4j/groupId
artifactIdslf4j-api/artifactId
version1.7.5/version
/dependency
dependency
groupIdorg.slf4j/groupId
artifactIdslf4j-log4j12/artifactId
version1.6.1/version
/dependency


dependency
groupIdorg.apache.cxf/groupId
artifactIdcxf-rt-transports-http-jetty/artifactId
version2.6.0.fuse-71-047/version
/dependency

dependency
groupIdorg.apache.camel/groupId
artifactIdcamel-test-spring/artifactId

Re: camel-cxf and HTTP BASIC authentication

2013-08-27 Thread contactreji
Hi Christian.. did you get a work around the problem?



--
View this message in context: 
http://camel.465427.n5.nabble.com/camel-cxf-and-HTTP-BASIC-authentication-tp5716163p5738071.html
Sent from the Camel - Users mailing list archive at Nabble.com.


Re: JAAS auth + Jetty - Exception

2013-08-27 Thread Bharath
Hi regi,

Replace org.eclipse.jetty.security;version=${jetty-version} with
org.eclipse.jetty.security;version=[7.0.0.,8.0.0) in your import package
of maven bundle plugin and try to deploy


Cheers!!!
Bharath.R



--
View this message in context: 
http://camel.465427.n5.nabble.com/JAAS-auth-Jetty-Exception-tp5738065p5738101.html
Sent from the Camel - Users mailing list archive at Nabble.com.


Re: Error in generated classes while importing to IDE

2013-08-27 Thread mahii.in87
Hi..
Thankss claus..



--
View this message in context: 
http://camel.465427.n5.nabble.com/Error-in-generated-classes-while-importing-to-IDE-tp5737936p5738104.html
Sent from the Camel - Users mailing list archive at Nabble.com.


Re: JAAS auth + Jetty - Exception

2013-08-27 Thread contactreji
Hi Bharat

You mean to say I should put it this way 




instructions
Import-Package 
javax.security.auth,

javax.security.auth.callback,

javax.security.auth.login,
javax.security.auth.spi,

org.apache.karaf.jaas.modules,

org.eclipse.jetty.plus.jaas;version=${jetty-version},

org.eclipse.jetty.security;version=8.0.0,
*
/Import-Package
/instructions


I am getting following exception with that..


*
08:22:42,684 | WARN  | y_perc_ssl (469) | / 
  
| 90 - org.eclipse.jetty.util - 7.6.7.v20120910 | Cannot install or update
bundle from
C:\Windows\system32\config\systemprofile\AppData\Local\Temp\install9134341085839189724.tmp
org.osgi.framework.BundleException: Update of bundle
com.outotec.mes-bw-copper_recovery_perc_ssl [469] failed.
at
org.apache.felix.framework.Felix.updateBundle(Felix.java:2492)[org.apache.felix.framework-4.0.3.fuse-71-047.jar:]
at
org.apache.felix.framework.BundleImpl.update(BundleImpl.java:965)[org.apache.felix.framework-4.0.3.fuse-71-047.jar:]
at
org.apache.felix.webconsole.internal.core.UpdateHelper.doRun(UpdateHelper.java:60)[294:org.apache.karaf.webconsole.console:2.3.0.fuse-71-047]
at
org.apache.felix.webconsole.internal.core.BaseUpdateInstallHelper.doRun(BaseUpdateInstallHelper.java:89)[294:org.apache.karaf.webconsole.console:2.3.0.fuse-71-047]
at
org.apache.felix.webconsole.internal.core.UpdateHelper.doRun(UpdateHelper.java:70)[294:org.apache.karaf.webconsole.console:2.3.0.fuse-71-047]
at
org.apache.felix.webconsole.internal.core.BaseUpdateInstallHelper.run(BaseUpdateInstallHelper.java:121)[294:org.apache.karaf.webconsole.console:2.3.0.fuse-71-047]
at java.lang.Thread.run(Unknown Source)[:1.6.0_45]
Caused by: java.lang.IllegalArgumentException: invalid version {7.0.0:
non-numeric {7
at
org.osgi.framework.Version.parseInt(Version.java:170)[karaf.jar:2.3.0.fuse-71-047]
at
org.osgi.framework.Version.init(Version.java:126)[karaf.jar:2.3.0.fuse-71-047]
at
org.apache.felix.framework.util.VersionRange.parse(VersionRange.java:98)[org.apache.felix.framework-4.0.3.fuse-71-047.jar:]
at
org.apache.felix.framework.util.manifestparser.ManifestParser.normalizeImportClauses(ManifestParser.java:299)[org.apache.felix.framework-4.0.3.fuse-71-047.jar:]
at
org.apache.felix.framework.util.manifestparser.ManifestParser.init(ManifestParser.java:163)[org.apache.felix.framework-4.0.3.fuse-71-047.jar:]
at
org.apache.felix.framework.BundleRevisionImpl.init(BundleRevisionImpl.java:119)[org.apache.felix.framework-4.0.3.fuse-71-047.jar:]
at
org.apache.felix.framework.BundleImpl.createRevision(BundleImpl.java:1191)[org.apache.felix.framework-4.0.3.fuse-71-047.jar:]
at
org.apache.felix.framework.BundleImpl.revise(BundleImpl.java:1133)[org.apache.felix.framework-4.0.3.fuse-71-047.jar:]
at
org.apache.felix.framework.Felix.updateBundle(Felix.java:2354)[org.apache.felix.framework-4.0.3.fuse-71-047.jar:]
... 6 more
Caused by: java.lang.NumberFormatException: For input string: {7
at java.lang.NumberFormatException.forInputString(Unknown
Source)[:1.6.0_45]
at java.lang.Integer.parseInt(Unknown Source)[:1.6.0_45]
at java.lang.Integer.parseInt(Unknown Source)[:1.6.0_45]
at
org.osgi.framework.Version.parseInt(Version.java:168)[karaf.jar:2.3.0.fuse-71-047]
... 14 more*


Is there any other way I should write it there? 



--
View this message in context: 
http://camel.465427.n5.nabble.com/JAAS-auth-Jetty-Exception-tp5738065p5738105.html
Sent from the Camel - Users mailing list archive at Nabble.com.


Re: JAAS auth + Jetty - Exception

2013-08-27 Thread contactreji
This is my latest POM

*?xml version=1.0 encoding=UTF-8 standalone=no?
project xmlns=http://maven.apache.org/POM/4.0.0;
xmlns:xsi=http://www.w3.org/2001/XMLSchema-instance;
xsi:schemaLocation=http://maven.apache.org/POM/4.0.0
http://maven.apache.org/maven-v4_0_0.xsd;

modelVersion4.0.0/modelVersion



version1.0.0/version
groupIdcom.outotec/groupId
artifactIdmes-bw-copper_recovery_perc_ssl/artifactId
nameproject-name/name
descriptionCreates a web service using the WSDL contract
first/description
packagingbundle/packaging


repositories
repository
idfusesource/id
nameFuseSource Release Repository/name

urlhttp://repo.fusesource.com/nexus/content/groups/public//url
snapshots
enabledfalse/enabled
/snapshots
releases
enabledtrue/enabled
/releases
/repository
repository
idfusesource.ea/id
nameFuseSource Community Early Access Release 
Repository/name

urlhttp://repo.fusesource.com/nexus/content/groups/ea/url
snapshots
enabledfalse/enabled
/snapshots
releases
enabledtrue/enabled
/releases
/repository
repository
idjboss-public-repository-group/id
nameJBoss Public Repository Group/name

urlhttp://repository.jboss.org/nexus/content/groups/public//url
layoutdefault/layout
releases
enabledtrue/enabled
updatePolicynever/updatePolicy
/releases
snapshots
enabledtrue/enabled
updatePolicydaily/updatePolicy
/snapshots
/repository











/repositories

pluginRepositories
pluginRepository
idfusesource/id
nameFuseSource Release Repository/name

urlhttp://repo.fusesource.com/nexus/content/groups/public//url
snapshots
enabledfalse/enabled
/snapshots
releases
enabledtrue/enabled
/releases
/pluginRepository
pluginRepository
idfusesource.ea/id
nameFuseSource Community Early Access Release 
Repository/name

urlhttp://repo.fusesource.com/nexus/content/groups/ea/url
snapshots
enabledfalse/enabled
/snapshots
releases
enabledtrue/enabled
/releases
/pluginRepository
/pluginRepositories


dependencies

dependency
groupIdorg.apache.camel/groupId
artifactIdcamel-core/artifactId
version2.10.0.fuse-71-047/version
/dependency

dependency
groupIdorg.apache.camel/groupId
artifactIdcamel-cxf/artifactId
version2.10.0.fuse-71-047/version
/dependency

dependency
groupIdlog4j/groupId
artifactIdlog4j/artifactId
version1.2.16/version
/dependency


dependency
groupIdorg.slf4j/groupId
artifactIdslf4j-api/artifactId
version1.7.5/version
/dependency
dependency
groupIdorg.slf4j/groupId
artifactIdslf4j-log4j12/artifactId
version1.6.1/version
/dependency


dependency
groupIdorg.apache.cxf/groupId
artifactIdcxf-rt-transports-http-jetty/artifactId
version2.6.0.fuse-71-047/version
/dependency

dependency
groupIdorg.apache.camel/groupId
artifactIdcamel-test-spring/artifactId
version2.10.0.fuse-71-047/version
  

Re: JAAS auth + Jetty - Exception

2013-08-27 Thread Bharath
Hi regi,

   It should be like this *version=[7.0.0.,8.0.0)* and not
version={7.0.0,8.0.0}.Please see the brackets what i have used and try

Cheers!!!
Bharath.R



--
View this message in context: 
http://camel.465427.n5.nabble.com/JAAS-auth-Jetty-Exception-tp5738065p5738107.html
Sent from the Camel - Users mailing list archive at Nabble.com.


Re: Camel service start/stop

2013-08-27 Thread Claus Ibsen
Hi

See also
http://camel.apache.org/lifecycle

If your class is used in a route as part of a process or bean then
Camel will manage its lifecycle (eg calling start/stop etc). And
enlist in JMX also.

Though if your bean is used outside Camel you need to handle this
yourself, for example as Christian said you can use addService method
on CamelContext to add it to Camel and it will then also manage its
lifecycle when Camel starts/stops.

If you want your bean to be in JMX. Then spring has a jmx exporter you
can use for that also.


On Tue, Aug 27, 2013 at 9:28 PM, kiranreddykasa kirankuma...@fss.co.in wrote:
 Hi i would like to know how to use the following class

 http://camel.apache.org/maven/current/camel-core/apidocs/org/apache/camel/support/ServiceSupport.html

 how can I make my custom class so that it is managed by camel ??



 -
 Regards

 kiran Reddy
 --
 View this message in context: 
 http://camel.465427.n5.nabble.com/Camel-service-start-stop-tp5738073.html
 Sent from the Camel - Users mailing list archive at Nabble.com.



-- 
Claus Ibsen
-
Red Hat, Inc.
Email: cib...@redhat.com
Twitter: davsclaus
Blog: http://davsclaus.com
Author of Camel in Action: http://www.manning.com/ibsen