Re: Camel 2.21.1 HttpComponent

2018-06-18 Thread Willem Jiang
The registerExtension method is provided by camel-core.
Please check if you updated the camel-core jar at the same time.

As the major version upgrade could introduce internal API change. We don't
suggest user just upgrade the version of camel-component unless it's a
patch release, such as 2.19.4 -> 2.19.5.


Willem Jiang

Twitter: willemjiang
Weibo: 姜宁willem

On Tue, Jun 19, 2018 at 5:24 AM, Binole, William J <
william.j.bin...@questdiagnostics.com> wrote:

> We recently upgraded our camel libs to the latest version (2.21.1) and
> have found that we can no longer instantiate HttpComponent. This is due to
> the constructor calling the registerExetnsion method which we have yet to
> find in the source.
>
> public HttpComponent(Class endpointClass) {
> super(endpointClass);
>
> registerExtension(HttpComponentVerifierExtension::new);
> }
> The above constructor fails with a no such method error on
> registerExtension. I dropped back to camel 2.19.5 and things work as that
> method is not being used. I would prefer to use the latest release 2.21.1
> but we have not been able to find a way around the problem with
> registerExtension. Since there does not appear to be any documentation
> around this any information on how to now instantiate HttpComponent would
> be appreciated.
>
> Bill
>
> __
> The contents of this message, together with any attachments, are intended
> only for the use of the person(s) to which they are addressed and may
> contain confidential and/or privileged information. Further, any medical
> information herein is confidential and protected by law. It is unlawful for
> unauthorized persons to use, review, copy, disclose, or disseminate
> confidential medical information. If you are not the intended recipient,
> immediately advise the sender and delete this message and any attachments.
> Any distribution, or copying of this message, or any attachment, is
> prohibited.


R: Camel 2.21.1 HttpComponent

2018-06-18 Thread Andrea Cosentino
Can you please show the code you're using?

Inviato da Yahoo Mail su Android 
 
  Il lun, 18 giu, 2018 alle 23:25, Binole, William 
J ha scritto:   We recently upgraded our 
camel libs to the latest version (2.21.1) and have found that we can no longer 
instantiate HttpComponent. This is due to the constructor calling the 
registerExetnsion method which we have yet to find in the source.

    public HttpComponent(Class endpointClass) {
        super(endpointClass);

        registerExtension(HttpComponentVerifierExtension::new);
    }
The above constructor fails with a no such method error on registerExtension. I 
dropped back to camel 2.19.5 and things work as that method is not being used. 
I would prefer to use the latest release 2.21.1 but we have not been able to 
find a way around the problem with registerExtension. Since there does not 
appear to be any documentation around this any information on how to now 
instantiate HttpComponent would be appreciated.

Bill

__
The contents of this message, together with any attachments, are intended only 
for the use of the person(s) to which they are addressed and may contain 
confidential and/or privileged information. Further, any medical information 
herein is confidential and protected by law. It is unlawful for unauthorized 
persons to use, review, copy, disclose, or disseminate confidential medical 
information. If you are not the intended recipient, immediately advise the 
sender and delete this message and any attachments. Any distribution, or 
copying of this message, or any attachment, is prohibited.  


RE: JdbcMessageIdRepository and SQL Server: schema

2018-06-18 Thread Mark Harris - ICT
Many thanks for this.

I had to do a bit more than this - as well as creating the database manually, I 
had to prefix the SQL Server schema into the SQL statements that are used by 
the repository (exists, create, query, insert, delete). I did this when 
creating my JdbcMessageIdRepository object.

Mark

-Original Message-
From: Claus Ibsen [mailto:claus.ib...@gmail.com] 
Sent: Monday, 18 June 2018 23:12
To: users@camel.apache.org
Subject: Re: JdbcMessageIdRepository and SQL Server: schema

Hi

You can either create the table before-hand yourself in the right schema.

Or you can try to configure the createString option on the 
JdbcMessageIdRepository, where you can specify the SQL statement it uses. The 
default one is:

CREATE TABLE CAMEL_MESSAGEPROCESSED (processorName VARCHAR(255), messageId 
VARCHAR(100), createdAt TIMESTAMP)

You can view it in the source code, and see what happens etc.

On Mon, Jun 18, 2018 at 5:12 AM, Mark Harris - ICT 
 wrote:
> Hello.
>
> I'm using Camel version 2.16.2 and am trying to create a JDBC message id 
> repository within a Microsoft SQL Server database.
>
> I have created the appropriate JdbcMessageIdRepository bean and populated it 
> with my SQL Server data source but I am finding that the 
> "CAMEL_MESSAGEPROCESSED" table is being automatically created in the default 
> schema of the database, which is called "dbo". I actually need to create the 
> database table in another schema, not the default one.
>
> I have looked through the Camel documentation but cannot find any reference 
> to how to do this.
>
> For other Java projects using JPA, I have used a similar approach and can add 
> database schema configuration when I set up my 
> javax.persistence.EntityManagerFactory. Can I do something similar for 
> Camel's JdbcMessageIdRepository?
>
> Thanks for any assistance.
>
> Mark

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

Attention:

This email together with any attachments is confidential and
may be subject to legal privilege.
If you are not the intended recipient please delete the message and
notify the sender.
Any views or opinions presented are solely those of the author and
will not necessarily reflect the views of Meridian Energy.


PLEASE CONSIDER THE ENVIRONMENT BEFORE PRINTING.



Camel 2.21.1 HttpComponent

2018-06-18 Thread Binole, William J
We recently upgraded our camel libs to the latest version (2.21.1) and have 
found that we can no longer instantiate HttpComponent. This is due to the 
constructor calling the registerExetnsion method which we have yet to find in 
the source.

public HttpComponent(Class endpointClass) {
super(endpointClass);

registerExtension(HttpComponentVerifierExtension::new);
}
The above constructor fails with a no such method error on registerExtension. I 
dropped back to camel 2.19.5 and things work as that method is not being used. 
I would prefer to use the latest release 2.21.1 but we have not been able to 
find a way around the problem with registerExtension. Since there does not 
appear to be any documentation around this any information on how to now 
instantiate HttpComponent would be appreciated.

Bill

__
The contents of this message, together with any attachments, are intended only 
for the use of the person(s) to which they are addressed and may contain 
confidential and/or privileged information. Further, any medical information 
herein is confidential and protected by law. It is unlawful for unauthorized 
persons to use, review, copy, disclose, or disseminate confidential medical 
information. If you are not the intended recipient, immediately advise the 
sender and delete this message and any attachments. Any distribution, or 
copying of this message, or any attachment, is prohibited.

"Multiple consumers for the same endpoint is not allowed" for mail endpoints

2018-06-18 Thread Patrick McKenna
Hi all,
I am a fairly new Camel user, so most likely the problem exists between 
chair and keyboard, but I have a question about URI uniqueness in the 
context of email providers. I have created some routes in my application 
that draw from several mailboxes on gmail and observed what seemed strange 
behavour.
I'm using camel-core and camel-mail version 2.21.1.
 
As part of a route builder I followed this sequence:
1 Create a MailConfiguration object and setting the username and password 
on it.
  MailConfiguration conf = new MailConfiguration();
  conf.setUsername(...
2 Create a MailComponent with the CamelContext.
  MailComponent component = new MailComponent(camelContext);
3 Set the MailComponent's configuration from the MailConfiguration object.
  component.setConfiguration(conf);
4 Creating the endpoint by passing a URI 
like "imaps://imap.gmail.com:993" to it.
  Endpoint exampleEndpoint = component.createEndpoint(uri);
 
Apparently because every endpoint created like so has the same URI, this 
is a problem. Each additional route, after the first, added caused a now 
familiar error message:
"Multiple consumers for the same endpoint is not allowed"
 
I solved the problem by adding the username to the URI and not to the 
MailConfiguration.
 
My question is why the configuration beyond the URI is not taken into 
account when deciding on the uniqueness of endpoints? Maybe there is a 
better way for me to deal with this issue. My motivation for taking the 
above approach was to leak as little information as possible into the 
logs.
 
  Thanks in advance,
 
-P.J. McKenna.



query limit of 200 records in camel-salesforce

2018-06-18 Thread Dicken George
In the rest api salesforce documentation, the standard query function is
done so
/vXX.X/query/?q=*SOQL query*

According to the salesforce documentation, when there are larger queries
with more than 200 records the query function allows us to query the next
set of 200 records by querying so.
/vXX.X/query/*query identifier*

You can find more information on this topic over here:
https://developer.salesforce.com/docs/atlas.en-us.206.0.api_rest.meta/api_rest/resources_query.htm

however as i understand from the camel-salesforce library, this function is
currently not implemented with the version camel-salesforce v2.22.0.

My question is:-
Are you planning to implement this function for the future?
Is there any other method we can query more than 200 records from
salesforce from the camel-salesforce library?

Thank you for your reply.

Kind regards
-- 

Dicken George


Re: JdbcMessageIdRepository and SQL Server: schema

2018-06-18 Thread Claus Ibsen
Hi

You can either create the table before-hand yourself in the right schema.

Or you can try to configure the createString option on the
JdbcMessageIdRepository, where you can specify the SQL statement it
uses. The default one is:

CREATE TABLE CAMEL_MESSAGEPROCESSED (processorName VARCHAR(255),
messageId VARCHAR(100), createdAt TIMESTAMP)

You can view it in the source code, and see what happens etc.

On Mon, Jun 18, 2018 at 5:12 AM, Mark Harris - ICT
 wrote:
> Hello.
>
> I'm using Camel version 2.16.2 and am trying to create a JDBC message id 
> repository within a Microsoft SQL Server database.
>
> I have created the appropriate JdbcMessageIdRepository bean and populated it 
> with my SQL Server data source but I am finding that the 
> "CAMEL_MESSAGEPROCESSED" table is being automatically created in the default 
> schema of the database, which is called "dbo". I actually need to create the 
> database table in another schema, not the default one.
>
> I have looked through the Camel documentation but cannot find any reference 
> to how to do this.
>
> For other Java projects using JPA, I have used a similar approach and can add 
> database schema configuration when I set up my 
> javax.persistence.EntityManagerFactory. Can I do something similar for 
> Camel's JdbcMessageIdRepository?
>
> Thanks for any assistance.
>
> Mark Harris - Software Developer
> Meridian Energy Limited
> 287-293 Durham Street North, Christchurch 8013
> DDI : 03 345 9080
> www.meridianenergy.co.nz
>
>
> Attention:
>
> This email together with any attachments is confidential and
> may be subject to legal privilege.
> If you are not the intended recipient please delete the message and
> notify the sender.
> Any views or opinions presented are solely those of the author and
> will not necessarily reflect the views of Meridian Energy.
>
>
> PLEASE CONSIDER THE ENVIRONMENT BEFORE PRINTING.
>



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


encoding problem on Jetty consumer side

2018-06-18 Thread Yacov Schondorf
I have a route defined from a Jetty endpoint. I am trying to read a path
parameter and print its contents:

from("jetty:http://localhost:8099/my-service?httpMethodRestrict=post;)
.process(exchange -> {
String path = (String)
exchange.getIn().getHeader("path");
System.out.println("got path: " + path);
});
}

I am calling this via curl on Windows passing Hebrew characters:

curl http://localhost:8099/my-service -X post -d "path=שדגכ"

The output I am getting is:
path=

I tried
curl http://localhost:8099/my-service -X post -H "Content-Type: text/html;
charset=UTF-8" -d "path:שדגכ"
In this case the path is not added as a Header at all so the code above
produces null. I am able to see the path in the debug window
using exchange.getIn().getBody(String.class) but then i see that the result
is again path:

Any idea how I can get set a utf-8 encoding properly on Camel side and on
curl side?


Re: Type converter misbehavior with camel-cxf and camel-mail

2018-06-18 Thread Claus Ibsen
Hi

Ah darn we can try to look into avoiding that type converter in
camel-mail - we can potentially do the conversion manually.
You are welcome to log a JIRA ticket.



On Tue, Jun 12, 2018 at 9:25 PM, Bagwell, Allen F
 wrote:
> I'm trying to integrate a CXF REST client into my camel route that already 
> has a SMTP endpoint incorporated into it via camel-mail. (This is using Camel 
> 2.18.5)
>
> When the client is invoked (this is configured via a blueprint), the 
> CxfRsProducer class in camel-cxf has the resource class loaded that I have 
> defined and using the proxy (CxfConstants.CAMEL_CXF_RS_USING_HTTP_API = 
> false, CxfConstants.OPERATION_NAME = "putStatus") it successfully looks up 
> the method the client needs, which in this case will use the String body of 
> the in-message to set as a parameter.
>
> This is where it gets weird. The CxfRsProducer needs to find a converter to 
> take the String body and turn it into an Object[]. In every other case where 
> I've done this, it finds the appropriate type converter and life is good.  
> However when camel-mail is present in the classpath the converter search 
> method picks:
>
> com.sun.mail.imap.SortTerm[] 
> org.apache.camel.component.mail.MailConverters.toSortTerm(String msg)
>
> This converter fails to produce the desired result and then a list of 
> fallback converters are tried. None of these work either and so the final 
> decision is to not use the in-message body but rather the in-message object 
> itself (DefaultMessage).  This of course isn't the correct solution, so the 
> whole CxfRsProducer bombs on a NoSuchMethodException because it can't find 
> the correct type parameter (String) that my resource class method needs.
>
> If I remove camel-mail, the CXF client works exactly as expected because it 
> finds the right String -> Object[] converter.
>
> I have never really had to muck around explicitly with converters before, but 
> is there a way to get these two dependencies to cooperate and pick the 
> correct converter? My current workaround is in my preparation of the exchange 
> just before the rest client is invoked I put the String I need to send into 
> an Object[] and set that as the new in-message body. Seems a bit of a kluge, 
> but it allows me to continue.
>
> Thanks!
> -Allen



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