Skip to content
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

Get the message failing #125

Closed
Lucgarg opened this issue Sep 6, 2021 · 2 comments
Closed

Get the message failing #125

Lucgarg opened this issue Sep 6, 2021 · 2 comments

Comments

@Lucgarg
Copy link

Lucgarg commented Sep 6, 2021

Hello, is there a possibility to retrieve the failed message?

Now, i am using recoverWith and I get it to send me the error message with the messages that have failed in a string, but it is not useful to me to retrieve the message.

I am thinking in send id of message in de Insert block, and then put this how x-ClickHouse-Query-Id, and recover and then send it again as an error in case the message is not sent
this is the code:

Await.result(source.runWith(sink).recoverWith{
case ex :RuntimeException => Future.successful(println(ex.getCause))
}, 10.seconds)

Exist a best posibility for get the message what fails?

@lwolters
Copy link
Contributor

Hi Lucgarg,

Your solution should work; although many others are valid too.

BTW: Did you consider using a logging framework, i.e. log4j that logs the message & cause. Right now you're only printing the stacktrace / cause. Did you also tried: println(ex.getMessage()) ?

@Lucgarg
Copy link
Author

Lucgarg commented Sep 14, 2021

Thank for the answer. Yes a probe with all options for print de error message but nothing.

After inquiring into the documentation in the community forums if I am not mistaken, when making a batch in clickhouse it does not return exactly the row that has failed you.

ClickHouse/ClickHouse#7522

@Lucgarg Lucgarg closed this as completed Sep 14, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants