Re: [PR] CAMEL-20010 [camel]

2023-10-18 Thread via GitHub


brunomendola commented on PR #11759:
URL: https://github.com/apache/camel/pull/11759#issuecomment-1770121409

   > > doInit ensures its only invoked once
   
   ...
   
   > If I understand it well, if `onInit()` was called only once as it should, 
the problem would not occur
   
   I think @essobedo has a point.
   
   I mean... the replacement was clearly happening twice, but the `onInit()` 
function should not be invoked twice by Camel.
   
   Maybe it's something related to some particular condition?
   The fact that the idempotentRepository was a bean, could it produce some 
unexpected behavior? Maybe something about concurrency? Is the onInit() call 
synchronized in some way?


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscr...@camel.apache.org

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org



Re: [PR] CAMEL-20010 [camel]

2023-10-18 Thread via GitHub


essobedo commented on PR #11759:
URL: https://github.com/apache/camel/pull/11759#issuecomment-1768781999

   > doInit ensures its only invoked once
   
   So why do we get what is described in the ticket? I quote:
   
   > JdbcMessageIdRepository is designed to replace the CAMEL_MESSAGEPROCESSED 
substring in the queries with the  custom table name in the onInit() function, 
but looks like this function is called multiple times and it keeps replacing 
the substring that is present also in the custom table name.
   
   If I understand it well, if `onInit()` was called only once as it should, 
the problem would not occur


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscr...@camel.apache.org

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org



Re: [PR] CAMEL-20010 [camel]

2023-10-18 Thread via GitHub


davsclaus merged PR #11759:
URL: https://github.com/apache/camel/pull/11759


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscr...@camel.apache.org

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org



Re: [PR] CAMEL-20010 [camel]

2023-10-18 Thread via GitHub


davsclaus commented on PR #11759:
URL: https://github.com/apache/camel/pull/11759#issuecomment-1768772742

   doInit ensures its only invoked once


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscr...@camel.apache.org

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org



Re: [PR] CAMEL-20010 [camel]

2023-10-18 Thread via GitHub


essobedo commented on PR #11759:
URL: https://github.com/apache/camel/pull/11759#issuecomment-1768755319

   I'm wondering if it is normal that the `JdbcMessageIdRepository` is 
initialized several times which is maybe more the problem to fix, WDYT?


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscr...@camel.apache.org

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org



Re: [PR] CAMEL-20010 [camel]

2023-10-18 Thread via GitHub


essobedo commented on code in PR #11759:
URL: https://github.com/apache/camel/pull/11759#discussion_r1363924922


##
components/camel-sql/src/main/java/org/apache/camel/processor/idempotent/jdbc/JdbcMessageIdRepository.java:
##
@@ -65,12 +75,12 @@ protected void doInit() throws Exception {
 
 if (tableName != null) {
 // update query strings from default table name to the new table 
name
-tableExistsString = 
tableExistsString.replaceFirst(DEFAULT_TABLENAME, tableName);
-createString = createString.replaceFirst(DEFAULT_TABLENAME, 
tableName);
-queryString = queryString.replaceFirst(DEFAULT_TABLENAME, 
tableName);
-insertString = insertString.replaceFirst(DEFAULT_TABLENAME, 
tableName);
-deleteString = deleteString.replaceFirst(DEFAULT_TABLENAME, 
tableName);
-clearString = clearString.replaceFirst(DEFAULT_TABLENAME, 
tableName);
+tableExistsString = 
DEFAULT_TABLE_EXISTS_STRING.replaceFirst(DEFAULT_TABLENAME, tableName);

Review Comment:
   You should use `replace` instead of `replaceFirst` to avoid using a regular 
expression behind the scenes



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscr...@camel.apache.org

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org



Re: [PR] CAMEL-20010 [camel]

2023-10-18 Thread via GitHub


github-actions[bot] commented on PR #11759:
URL: https://github.com/apache/camel/pull/11759#issuecomment-1768462881

   :star2: Thank you for your contribution to the Apache Camel project! :star2: 
   
   :robot: CI automation will test this PR automatically.
   
   :camel: Apache Camel Committers, please review the following items:
   
   * First-time contributors **require MANUAL approval** for the GitHub Actions 
to run
   
   * You can use the command `/component-test (camel-)component-name1 
(camel-)component-name2..` to request a test from the test bot.
   
   * You can label PRs using `build-all`, `build-dependents`, `skip-tests` and 
`test-dependents` to fine-tune the checks executed by this PR.
   
   * Build and test logs are available in the Summary page. **Only** [Apache 
Camel committers](https://camel.apache.org/community/team/#committers) have 
access to the summary. 
   
   * :warning: Be careful when sharing logs. Review their contents before 
sharing them publicly.


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscr...@camel.apache.org

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org



[PR] CAMEL-20010 [camel]

2023-10-18 Thread via GitHub


brunomendola opened a new pull request, #11759:
URL: https://github.com/apache/camel/pull/11759

   # Description
   
   Preserve default queries in `JdbcMessageIdRepository` to avoid replacing the 
table name more than once.
   
   Solves CAMEL-20010.
   
   # Target
   
   - [x] I checked that the commit is targeting the correct branch (note that 
Camel 3 uses `camel-3.x`, whereas Camel 4 uses the `main` branch)
   
   # Tracking
   - [x] If this is a large change, bug fix, or code improvement, I checked 
there is a [JIRA issue](https://issues.apache.org/jira/browse/CAMEL) filed for 
the change (usually before you start working on it).
   
   
   
   # Apache Camel coding standards and style
   
   - [x] I checked that each commit in the pull request has a meaningful 
subject line and body.
   
   
   
   - [x] I have run `mvn clean install -DskipTests` locally and I have 
committed all auto-generated changes
   
   
   
   


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscr...@camel.apache.org

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org