-
Notifications
You must be signed in to change notification settings - Fork 99
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
CamelFileSink Connector appendChars = \n not working #1208
Comments
Hello, Please, can you try defining the URLs parameters as properties and let us know the result? Such as:
The full list of properties is here: https://camel.apache.org/camel-kafka-connector/latest/reference/connectors/camel-file-kafka-sink-connector.html |
We tried using the properties instead of file sink url and the result is same. It gives us the same error. Here is the error messages after defining the properties : \nCaused by: org.apache.camel.ResolveEndpointFailedException: Failed to resolve endpoint: file:/user/app/folder?appendChars=\n&autoCreate=true&charset=UTF-8&fileExist=Append&fileName=messages-${date:now:yyyyMMdd}.txt&forceWrites=true due to: Illegal character in query at index 34: file:/user/app/folder?appendChars=\n&autoCreate=true&charset=UTF-8&fileExist=Append&fileName=messages-$%7Bdate:now:yyyyMMdd%7D.txt&forceWrites=true\n\tat Here is our full connect config : { |
Can you try escaping the new line char, please? Such as |
We did that too but no change in result. same error. \nCaused by: org.apache.camel.ResolveEndpointFailedException: Failed to resolve endpoint: file:/user/app/folder?appendChars=\n&autoCreate=true&charset=UTF-8&fileExist=Append&fileName=messages-${date:now:yyyyMMdd}.txt&forceWrites=true due to: Illegal character in query at index 34: file:/user/app/folder?appendChars=\n&autoCreate=true&charset=UTF-8&fileExist=Append&fileName=messages-$%7Bdate:now:yyyyMMdd%7D.txt&forceWrites=true\n\ |
Thanks for double checking. I'll investigate this today (or, at worst, in a few days). |
@ChhatralaNirmal I've run a test with the append char as |
@orpiske - thank you so much for this advise. It worked perfectly fine and we were able to get the messages on next line. |
I am glad it worked. @oscerd / @valdar I am a bit conflicted about this one: I'm wondering if we should fix the docs or the code. Any ideas? |
Is the "correct" value "\n" ? What would be the fix in the code? |
Long story short is this: when using special chars for Therefore, I'm wondering if we should somehow fix this in CKC code or just update our documentation to instruct users to use |
I documented this in multiple places so that users have a greater chance to find out the information. Therefore, I am closing this one. Please refer to PR #1220 for details about the changes. |
Hello, We are using CamelFileSink connector to read the messages from Kafka and dump into file but we want each messages to be written in next line in file. We have been trying to use appendChars option with double slash \n but it doesn't work.
Here is our file sink url :
file:/user/app/folder?appendChars=\n&autoCreate=true&fileExist=Append&fileName=messages-${date:now:yyyyMMdd}.txt&forceWrites=true&charset=utf-8
Here is what the error we get :
Caused by: org.apache.camel.ResolveEndpointFailedException: Failed to resolve endpoint: file:/user/app/folder?appendChars=\n&autoCreate=true&fileExist=Append&fileName=messages-${date:now:yyyyMMdd}.txt&forceWrites=true&charset=utf-8 due to: Illegal character in query at index 34: file:/user/app/folder?appendChars=\n&autoCreate=true&fileExist=Append&fileName=messages-$%7Bdate:now:yyyyMMdd%7D.txt&forceWrites=true&charset=utf-8\n\tat org.apache.camel.support.EndpointHelper.normalizeEndpointUri(EndpointHelper.java:156)\n\tat org.apache.camel.support.NormalizedUri.newNormalizedUri(NormalizedUri.java:46)\n\tat
The text was updated successfully, but these errors were encountered: