[jira] [Commented] (CAMEL-12603) Thread stuck in re-delivery loop after interrupting it
[ https://issues.apache.org/jira/browse/CAMEL-12603?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16532322#comment-16532322 ] ASF GitHub Bot commented on CAMEL-12603: oscerd commented on issue #2396: CAMEL-12603 - Interrupt fix for messages stuck in a re-delivery loop URL: https://github.com/apache/camel/pull/2396#issuecomment-402377752 I'm preparing to merge this one. This is an automated message from the Apache Git Service. To respond to the message, please log on GitHub and use the URL above to go to the specific comment. For queries about this service, please contact Infrastructure at: us...@infra.apache.org > Thread stuck in re-delivery loop after interrupting it > -- > > Key: CAMEL-12603 > URL: https://issues.apache.org/jira/browse/CAMEL-12603 > Project: Camel > Issue Type: Bug > Components: camel-core >Reporter: Nick Horne >Priority: Major > Fix For: 2.21.2, 2.22.1, 2.23.0 > > > I have experienced an issue where we could not cancel a message stuck in a > re-delivery cycle. I was using Jolokia and calling the interrupt method on > the DefaultAsyncProcessorAwaitManager for the blocked exchange and I had > expected the re-delivery cycle to stop. > This does not happen, and the blocked message continues to get executed and > re-delivered. The mapping does get removed from the in-flight messages > though. I can see also that the RejectedExecutionException set by the > interrupt is also overwritten by the exception thrown by our failing bean. I > think the problem here is that there are no checks for this > RejectedExecutionException during the re-delivery cycle. > It seems like the following part of the RedeliveryErrorHandler::call should > pick up the fact that the exchange has been interrupted: > {code:java} > // only process if the exchange hasn't failed > // and it has not been handled by the error processor > if (isDone(exchange)) { > callback.done(false); > return; > }{code} > This is an issue if you have configured a long re-delivery cycle and you have > a message retrying that you know will never succeed. -- This message was sent by Atlassian JIRA (v7.6.3#76005)
[jira] [Created] (CAMEL-12622) camel-ssh - Potential NullPointerException due to unboxing if channel.getExitStatus() is null
Önder Sezgin created CAMEL-12622: Summary: camel-ssh - Potential NullPointerException due to unboxing if channel.getExitStatus() is null Key: CAMEL-12622 URL: https://issues.apache.org/jira/browse/CAMEL-12622 Project: Camel Issue Type: Improvement Components: camel-ssh Affects Versions: 2.22.0 Reporter: Önder Sezgin Assignee: Önder Sezgin Fix For: 2.23.0 -- This message was sent by Atlassian JIRA (v7.6.3#76005)
[jira] [Commented] (CAMEL-11675) @Metadata should be repeatable
[ https://issues.apache.org/jira/browse/CAMEL-11675?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16532307#comment-16532307 ] ASF GitHub Bot commented on CAMEL-11675: onderson commented on a change in pull request #2391: CAMEL-11675 - Repetable @Metadata annotation and amend apt for tooling URL: https://github.com/apache/camel/pull/2391#discussion_r200018087 ## File path: tooling/apt/src/main/java/org/apache/camel/tools/apt/CoreEipAnnotationProcessor.java ## @@ -219,8 +219,8 @@ protected EipModel findEipModelProperties(ProcessingEnvironment processingEnv, R boolean deprecated = classElement.getAnnotation(Deprecated.class) != null; model.setDeprecated(deprecated); -Metadata metadata = classElement.getAnnotation(Metadata.class); -if (metadata != null) { +Metadata[] metadataArray = classElement.getAnnotationsByType(Metadata.class); +for (Metadata metadata : metadataArray) { Review comment: not sure what i was thinking. i will look into it again. This is an automated message from the Apache Git Service. To respond to the message, please log on GitHub and use the URL above to go to the specific comment. For queries about this service, please contact Infrastructure at: us...@infra.apache.org > @Metadata should be repeatable > -- > > Key: CAMEL-11675 > URL: https://issues.apache.org/jira/browse/CAMEL-11675 > Project: Camel > Issue Type: Improvement > Components: camel-core >Reporter: Luca Burgazzoli >Priority: Minor > Fix For: 2.23.0 > > > As today @Metadata is not repeatable so it is not easy to add multiple > information to i.e. a component, it would be nice to write something like: > {code:java} > @Metadata(key = "platforms", enums = { "spring", "spring-boot", "osgi" }) > @Metadata(key = "extensions", types = { MyExtension.cass }) > class MyComponent extends DefaultComponent { > } > {code} -- This message was sent by Atlassian JIRA (v7.6.3#76005)
[jira] [Commented] (CAMEL-11675) @Metadata should be repeatable
[ https://issues.apache.org/jira/browse/CAMEL-11675?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16532308#comment-16532308 ] ASF GitHub Bot commented on CAMEL-11675: onderson commented on a change in pull request #2391: CAMEL-11675 - Repetable @Metadata annotation and amend apt for tooling URL: https://github.com/apache/camel/pull/2391#discussion_r200018147 ## File path: tooling/apt/src/main/java/org/apache/camel/tools/apt/EndpointAnnotationProcessor.java ## @@ -359,12 +359,22 @@ protected ComponentModel findComponentProperties(RoundEnvironment roundEnv, UriE model.setLenientProperties(uriEndpoint.lenientProperties()); model.setAsync(implementsInterface(processingEnv, roundEnv, endpointClassElement, "org.apache.camel.AsyncEndpoint")); +String deprecationNote = null; // what is the first version this component was added to Apache Camel String firstVersion = uriEndpoint.firstVersion(); -if (Strings.isNullOrEmpty(firstVersion) && endpointClassElement.getAnnotation(Metadata.class) != null) { -// fallback to @Metadata if not from @UriEndpoint -firstVersion = endpointClassElement.getAnnotation(Metadata.class).firstVersion(); +Metadata[] metadataArray = endpointClassElement.getAnnotationsByType(Metadata.class); +for(Metadata metadata : metadataArray) { Review comment: there was not checkstyle issue AFAIR. will check again. This is an automated message from the Apache Git Service. To respond to the message, please log on GitHub and use the URL above to go to the specific comment. For queries about this service, please contact Infrastructure at: us...@infra.apache.org > @Metadata should be repeatable > -- > > Key: CAMEL-11675 > URL: https://issues.apache.org/jira/browse/CAMEL-11675 > Project: Camel > Issue Type: Improvement > Components: camel-core >Reporter: Luca Burgazzoli >Priority: Minor > Fix For: 2.23.0 > > > As today @Metadata is not repeatable so it is not easy to add multiple > information to i.e. a component, it would be nice to write something like: > {code:java} > @Metadata(key = "platforms", enums = { "spring", "spring-boot", "osgi" }) > @Metadata(key = "extensions", types = { MyExtension.cass }) > class MyComponent extends DefaultComponent { > } > {code} -- This message was sent by Atlassian JIRA (v7.6.3#76005)
[jira] [Resolved] (CAMEL-12621) Rest DSL with Jetty9 components returns 404 instead of 405, when http method is not supported
[ https://issues.apache.org/jira/browse/CAMEL-12621?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ] Freeman Fang resolved CAMEL-12621. -- Resolution: Fixed Fix Version/s: 2.23.0 2.22.1 2.21.2 > Rest DSL with Jetty9 components returns 404 instead of 405, when http method > is not supported > - > > Key: CAMEL-12621 > URL: https://issues.apache.org/jira/browse/CAMEL-12621 > Project: Camel > Issue Type: Bug >Reporter: Freeman Fang >Assignee: Freeman Fang >Priority: Major > Fix For: 2.21.2, 2.22.1, 2.23.0 > > > For example when a GET request is expected but client send a POST, currently > it returns 404, however, it should return 405 instead, as resource actually > exists and just the HTTP method mismatch -- This message was sent by Atlassian JIRA (v7.6.3#76005)
[jira] [Assigned] (CAMEL-12621) Rest DSL with Jetty9 components returns 404 instead of 405, when http method is not supported
[ https://issues.apache.org/jira/browse/CAMEL-12621?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ] Freeman Fang reassigned CAMEL-12621: Assignee: Freeman Fang > Rest DSL with Jetty9 components returns 404 instead of 405, when http method > is not supported > - > > Key: CAMEL-12621 > URL: https://issues.apache.org/jira/browse/CAMEL-12621 > Project: Camel > Issue Type: Bug >Reporter: Freeman Fang >Assignee: Freeman Fang >Priority: Major > > For example when a GET request is expected but client send a POST, currently > it returns 404, however, it should return 405 instead, as resource actually > exists and just the HTTP method mismatch -- This message was sent by Atlassian JIRA (v7.6.3#76005)
[jira] [Created] (CAMEL-12621) Rest DSL with Jetty9 components returns 404 instead of 405, when http method is not supported
Freeman Fang created CAMEL-12621: Summary: Rest DSL with Jetty9 components returns 404 instead of 405, when http method is not supported Key: CAMEL-12621 URL: https://issues.apache.org/jira/browse/CAMEL-12621 Project: Camel Issue Type: Bug Reporter: Freeman Fang For example when a GET request is expected but client send a POST, currently it returns 404, however, it should return 405 instead, as resource actually exists and just the HTTP method mismatch -- This message was sent by Atlassian JIRA (v7.6.3#76005)
[jira] [Created] (CAMEL-12620) CompletionAwareAggregationStrategy onCompletition method null exchange.
Luis Miguel created CAMEL-12620: --- Summary: CompletionAwareAggregationStrategy onCompletition method null exchange. Key: CAMEL-12620 URL: https://issues.apache.org/jira/browse/CAMEL-12620 Project: Camel Issue Type: Bug Reporter: Luis Miguel Hello. We have a camel project to process some Csv files, we created a class implementing "CompletionAwareAggregationStrategy" in order to aggregate each row processed and we override the methods "aggregate" and "onCompletion" from it. The way we process the Csv file is parallelized with the "parallelProcessing" and indicating an "executorService" with 8 concurrently threads. We are having a weird issue that rarely happens, and is that in the middle of the process of the file, the method "onCompletion" is being called (even when the file is not complete yet) and it sets the argument "Exchange" as NULL so the whole camel route is messed up. As I said this rarely happens when we try to reprocess the file the error is gone. Here's the main route that process the CSV file, notice that for the split process we create an instance of "CsvAggregationStrategy" {code:java} @Qualifier("executorServicePublicationItemCsv") @Autowired private ExecutorService executorService; @Override public void configure() throws Exception { String[] header = Arrays.stream(PublicationItemCsvFields.values()) .map(PublicationItemCsvFields::getText).toArray(String[]::new); Map csvFieldsByEntityAttribute = new HashMap<>(); mapFields(csvFieldsByEntityAttribute); //@formatter:off from("file:publicationItemData?delete={{routes.push-csv-to-service.delete-source-file}}") .streamCaching() .routeId("push-publication-item-csv-to-service") .onException(Exception.class) .handled(true) .log(LoggingLevel.ERROR, "Error in publication item route, sending an email: ${exception.message} ${exception.stacktrace}") .to("direct:sendImportErrorReport") .end() .log(LoggingLevel.INFO, "Beginning to import publication item CSV: ${file:onlyname}") .unmarshal(new CsvDataFormat() .setSkipHeaderRecord(true) .setNullString(EMPTY) .setLazyLoad(true)) .split(body(), new CsvAggregationStrategy()) .streaming() .parallelProcessing().executorService(executorService) .to("direct:publication-item-splitter") .end() .choice() .when(simple("${exchangeProperty.aggregationError} != null")) .log("An error occurred when aggregating exchanges, sending an email with the error.") .setProperty("original_body", body()) .to("direct:sendAggregationErrorEmail") .setBody(exchangeProperty("original_body")) .end() .choice() .when(simple("${exchangeProperty.badCsvData.size()} > 0")) .setBody(simple("${exchangeProperty.badCsvData}")) .marshal(new CsvDataFormat().setHeader(header)) .setProperty("badRowsBody").simple("${body}") .end() .choice() .when(simple("${exchangeProperty.successfulRecords.size()} > 0")) .setBody(simple("${exchangeProperty.successfulRecords}")) .marshal(new CsvDataFormat().setHeader(header)) .setProperty("successfulRowsBody").simple("${body}") .end() .to("direct:sendImportReport").end() .log("Completed import for publication item CSV: '${file:onlyname}'"); from("direct:publication-item-splitter") .streamCaching() .routeId("push-publication-item-splitter") .onException(PublicationItemImportException.class) .handled(true) .log(LoggingLevel.ERROR, "Error importing publication item data: ${exception.message} ${exception.stacktrace}") .end() .onException(HttpHostConnectException.class) .handled(true) .log(LoggingLevel.ERROR, "Error connecting to publication item service host: ${exception.host}. Request body: ${body}") .end() .onException(HttpOperationFailedException.class) .handled(true) .log(LoggingLevel.ERROR, "Error received from publication item service: HTTP ${exception.statusCode}. Response body: ${exception.responseBody}. Request body: ${body}") .end() .onException(Exception.class) .handled(true) .log(LoggingLevel.ERROR, "Error: ${exception.message} ${exception.stacktrace}") .end() .setProperty("csvRowData").simple("${body}", List.class) .setProperty("csvFieldsByEntityAttribute").constant(csvFieldsByEntityAttribute) .bean(publicationItemCSVDataHandler) .marshal().json(JsonLibrary.Jackson) .setHeader(HttpHeaders.AUTHORIZATION, simple("Basic "+propertyServiceAuthorization)) .log("Item ID: ${property.itemId}") .choice() .when().simple("${property.itemId} != null") .setHeader(Exchange.HTTP_PATH, simple("${property.itemId}")) .to("rest:PUT:items?host={{backend.event-service.host}}") .otherwise() .to("rest:POST:items?host={{backend.event-service.host}}") .end() .setProperty("responseId").jsonpath("$.id", true) .setProperty("idColumnPosition").constant(PublicationItemCsvFields.ID.getNumber()) .choice() .when(exchangeProperty("responseId").isNull()) .throwException(PublicationItemImportException.class, "Unexpected rest " + "response (no id returned)") .otherwise() .end(); //@formatter:o
[jira] [Updated] (CAMEL-12613) Camel file endpoint loses modification date and length information when preMove is used
[ https://issues.apache.org/jira/browse/CAMEL-12613?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ] John Poth updated CAMEL-12613: -- Fix Version/s: 2.23.0 > Camel file endpoint loses modification date and length information when > preMove is used > --- > > Key: CAMEL-12613 > URL: https://issues.apache.org/jira/browse/CAMEL-12613 > Project: Camel > Issue Type: Bug > Components: camel-core >Affects Versions: 2.21.1 >Reporter: John Poth >Assignee: John Poth >Priority: Major > Fix For: 2.23.0 > > > I'll work on a PR with a unit test, thanks! -- This message was sent by Atlassian JIRA (v7.6.3#76005)
[jira] [Resolved] (CAMEL-12613) Camel file endpoint loses modification date and length information when preMove is used
[ https://issues.apache.org/jira/browse/CAMEL-12613?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ] John Poth resolved CAMEL-12613. --- Resolution: Fixed > Camel file endpoint loses modification date and length information when > preMove is used > --- > > Key: CAMEL-12613 > URL: https://issues.apache.org/jira/browse/CAMEL-12613 > Project: Camel > Issue Type: Bug > Components: camel-core >Affects Versions: 2.21.1 >Reporter: John Poth >Assignee: John Poth >Priority: Major > Fix For: 2.23.0 > > > I'll work on a PR with a unit test, thanks! -- This message was sent by Atlassian JIRA (v7.6.3#76005)
[jira] [Commented] (CAMEL-12613) Camel file endpoint loses modification date and length information when preMove is used
[ https://issues.apache.org/jira/browse/CAMEL-12613?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16531497#comment-16531497 ] ASF GitHub Bot commented on CAMEL-12613: Github user johnpoth closed the pull request at: https://github.com/apache/camel/pull/2405 > Camel file endpoint loses modification date and length information when > preMove is used > --- > > Key: CAMEL-12613 > URL: https://issues.apache.org/jira/browse/CAMEL-12613 > Project: Camel > Issue Type: Bug > Components: camel-core >Affects Versions: 2.21.1 >Reporter: John Poth >Assignee: John Poth >Priority: Major > > I'll work on a PR with a unit test, thanks! -- This message was sent by Atlassian JIRA (v7.6.3#76005)
[jira] [Commented] (CAMEL-12613) Camel file endpoint loses modification date and length information when preMove is used
[ https://issues.apache.org/jira/browse/CAMEL-12613?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16531496#comment-16531496 ] ASF GitHub Bot commented on CAMEL-12613: johnpoth closed pull request #2405: [CAMEL-12613] Use GenericFile's absolute path when updating file head… URL: https://github.com/apache/camel/pull/2405 This is a PR merged from a forked repository. As GitHub hides the original diff on merge, it is displayed below for the sake of provenance: As this is a foreign pull request (from a fork), the diff is supplied below (as it won't show otherwise due to GitHub magic): diff --git a/camel-core/src/main/java/org/apache/camel/component/file/FileConsumer.java b/camel-core/src/main/java/org/apache/camel/component/file/FileConsumer.java index ccf73e7cef7..c984d6644c9 100644 --- a/camel-core/src/main/java/org/apache/camel/component/file/FileConsumer.java +++ b/camel-core/src/main/java/org/apache/camel/component/file/FileConsumer.java @@ -241,8 +241,12 @@ protected boolean isMatched(GenericFile file, String doneFileName, List file, Message message) { -long length = file.getFile().length(); -long modified = file.getFile().lastModified(); +File upToDateFile = file.getFile(); +if (fileHasMoved(file)) { +upToDateFile = new File(file.getAbsoluteFilePath()); +} +long length = upToDateFile.length(); +long modified = upToDateFile.lastModified(); file.setFileLength(length); file.setLastModified(modified); if (length >= 0) { @@ -257,4 +261,9 @@ protected void updateFileHeaders(GenericFile file, Message message) { public FileEndpoint getEndpoint() { return (FileEndpoint) super.getEndpoint(); } + +private boolean fileHasMoved(GenericFile file) { +// GenericFile's absolute path is always up to date whereas the underlying file is not +return !file.getFile().getAbsolutePath().equals(file.getAbsoluteFilePath()); +} } diff --git a/camel-core/src/test/java/org/apache/camel/component/file/FileConsumerPreMoveLastModifiedTest.java b/camel-core/src/test/java/org/apache/camel/component/file/FileConsumerPreMoveLastModifiedTest.java new file mode 100644 index 000..719145d1f13 --- /dev/null +++ b/camel-core/src/test/java/org/apache/camel/component/file/FileConsumerPreMoveLastModifiedTest.java @@ -0,0 +1,61 @@ +/** + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed with + * this work for additional information regarding copyright ownership. + * The ASF licenses this file to You under the Apache License, Version 2.0 + * (the "License"); you may not use this file except in compliance with + * the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package org.apache.camel.component.file; + +import org.apache.camel.ContextTestSupport; +import org.apache.camel.Exchange; +import org.apache.camel.Processor; +import org.apache.camel.builder.RouteBuilder; +import org.apache.camel.component.mock.MockEndpoint; + +public class FileConsumerPreMoveLastModifiedTest extends ContextTestSupport { + +@Override +protected void setUp() throws Exception { +deleteDirectory("target/premove"); +super.setUp(); +} + +public void testPreMoveLastModified() throws Exception { +MockEndpoint mock = getMockEndpoint("mock:result"); +mock.expectedMessageCount(1); +template.sendBodyAndHeader("file://target/premove", "Hello World", Exchange.FILE_NAME, "hello.txt"); + +assertMockEndpointsSatisfied(); +} + +@Override +protected RouteBuilder createRouteBuilder() throws Exception { +return new RouteBuilder() { +@Override +public void configure() throws Exception { + from("file://target/premove?preMove=work/work-${file:name}&initialDelay=0&delay=10&keepLastModified=true") +.process(new LastModifiedCheckerProcessor()) +.log("Got file ${file:name} modified=${file:modified}") +.to("mock:result"); +} +}; +} + +private static class LastModifiedCheckerProcessor implements Processor { + +public void process(Exchange exchange) throws Exception { +assertTrue(exchange.getIn().getHeader(Exchange.FILE_LAST_MODIFIED, Long.class) > 0L); +assertTrue(exchange.getIn().getHeader(Exchange.FILE_LENGTH, Long.c
[jira] [Commented] (CAMEL-12613) Camel file endpoint loses modification date and length information when preMove is used
[ https://issues.apache.org/jira/browse/CAMEL-12613?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16531490#comment-16531490 ] ASF GitHub Bot commented on CAMEL-12613: GitHub user johnpoth opened a pull request: https://github.com/apache/camel/pull/2405 [CAMEL-12613] Use GenericFile's absolute path when updating file head… …ers as it is updated when the underlying file is moved https://issues.apache.org/jira/browse/CAMEL-12613 Thanks! You can merge this pull request into a Git repository by running: $ git pull https://github.com/johnpoth/camel CAMEL-12613 Alternatively you can review and apply these changes as the patch at: https://github.com/apache/camel/pull/2405.patch To close this pull request, make a commit to your master/trunk branch with (at least) the following in the commit message: This closes #2405 commit 77b24cde0ee5e6fb53f3510399cbfce3192f4eed Author: jpoth Date: 2018-07-02T14:10:04Z [CAMEL-12613] Use GenericFile's absolute path when updating file headers as it is updated when the underlying file is moved > Camel file endpoint loses modification date and length information when > preMove is used > --- > > Key: CAMEL-12613 > URL: https://issues.apache.org/jira/browse/CAMEL-12613 > Project: Camel > Issue Type: Bug > Components: camel-core >Affects Versions: 2.21.1 >Reporter: John Poth >Assignee: John Poth >Priority: Major > > I'll work on a PR with a unit test, thanks! -- This message was sent by Atlassian JIRA (v7.6.3#76005)
[jira] [Commented] (CAMEL-12613) Camel file endpoint loses modification date and length information when preMove is used
[ https://issues.apache.org/jira/browse/CAMEL-12613?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16531489#comment-16531489 ] ASF GitHub Bot commented on CAMEL-12613: johnpoth opened a new pull request #2405: [CAMEL-12613] Use GenericFile's absolute path when updating file head… URL: https://github.com/apache/camel/pull/2405 …ers as it is updated when the underlying file is moved https://issues.apache.org/jira/browse/CAMEL-12613 Thanks! This is an automated message from the Apache Git Service. To respond to the message, please log on GitHub and use the URL above to go to the specific comment. For queries about this service, please contact Infrastructure at: us...@infra.apache.org > Camel file endpoint loses modification date and length information when > preMove is used > --- > > Key: CAMEL-12613 > URL: https://issues.apache.org/jira/browse/CAMEL-12613 > Project: Camel > Issue Type: Bug > Components: camel-core >Affects Versions: 2.21.1 >Reporter: John Poth >Assignee: John Poth >Priority: Major > > I'll work on a PR with a unit test, thanks! -- This message was sent by Atlassian JIRA (v7.6.3#76005)
[jira] [Commented] (CAMEL-12603) Thread stuck in re-delivery loop after interrupting it
[ https://issues.apache.org/jira/browse/CAMEL-12603?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16531374#comment-16531374 ] ASF GitHub Bot commented on CAMEL-12603: NickUK commented on a change in pull request #2396: CAMEL-12603 - Interrupt fix for messages stuck in a re-delivery loop URL: https://github.com/apache/camel/pull/2396#discussion_r199804106 ## File path: camel-core/src/test/java/org/apache/camel/processor/async/AsyncProcessorAwaitManagerInterruptWithRedeliveryTest.java ## @@ -0,0 +1,136 @@ +/** + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed with + * this work for additional information regarding copyright ownership. + * The ASF licenses this file to You under the Apache License, Version 2.0 + * (the "License"); you may not use this file except in compliance with + * the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package org.apache.camel.processor.async; + +import org.apache.camel.CamelExecutionException; +import org.apache.camel.ContextTestSupport; +import org.apache.camel.builder.RouteBuilder; +import org.apache.camel.spi.AsyncProcessorAwaitManager; +import org.apache.camel.util.jndi.JndiContext; + +import javax.naming.Context; +import java.util.Collection; +import java.util.concurrent.CountDownLatch; +import java.util.concurrent.RejectedExecutionException; +import java.util.concurrent.TimeUnit; + +import static org.mockito.Mockito.atMost; +import static org.mockito.Mockito.spy; +import static org.mockito.Mockito.verify; + +public class AsyncProcessorAwaitManagerInterruptWithRedeliveryTest extends ContextTestSupport { +private CountDownLatch latch; +private MyBean bean; + +@Override +protected void setUp() throws Exception { +latch = new CountDownLatch(2); +bean = spy(new MyBean(latch)); +super.setUp(); +} + +public void testAsyncAwaitInterrupt() throws Exception { + context.getAsyncProcessorAwaitManager().getStatistics().setStatisticsEnabled(true); + +assertEquals(0, context.getAsyncProcessorAwaitManager().size()); + +getMockEndpoint("mock:before").expectedBodiesReceived("Hello Camel"); +getMockEndpoint("mock:result").expectedMessageCount(0); +getMockEndpoint("mock:error").expectedMessageCount(0); + +createThreadToInterrupt(); +try { +template.sendBody("direct:start", "Hello Camel"); +fail("Should throw exception"); +} catch (CamelExecutionException e) { +RejectedExecutionException cause = assertIsInstanceOf(RejectedExecutionException.class, e.getCause()); +assertTrue(cause.getMessage().startsWith("Interrupted while waiting for asynchronous callback")); +} + +assertMockEndpointsSatisfied(); + +// Check we have not reached the full 5 re-deliveries +verify(bean, atMost(4)).callMe(); + +assertEquals(0, context.getAsyncProcessorAwaitManager().size()); +assertEquals(1, context.getAsyncProcessorAwaitManager().getStatistics().getThreadsBlocked()); +assertEquals(1, context.getAsyncProcessorAwaitManager().getStatistics().getThreadsInterrupted()); +} + +private void createThreadToInterrupt() { +new Thread(() -> { +// Allow some time for camel exchange to enter the re-deliveries +try { +latch.await(1, TimeUnit.SECONDS); +} catch (InterruptedException e) { +e.printStackTrace(); +} + +// Get our blocked thread +int size = context.getAsyncProcessorAwaitManager().size(); +System.out.println("In-flight messages: " + size); Review comment: I have removed these This is an automated message from the Apache Git Service. To respond to the message, please log on GitHub and use the URL above to go to the specific comment. For queries about this service, please contact Infrastructure at: us...@infra.apache.org > Thread stuck in re-delivery loop after interrupting it > -- > > Key: CAMEL-12603 > URL: https://issues.apache.org/jira/browse/CAMEL-12603 > Project: Camel > Issue Type: Bug > Components: camel-core >Reporter: Nick Horne >Priority: Major >
[jira] [Resolved] (CAMEL-12615) tools.jar missing in Java 9+ needed by camel-chronicle-starter
[ https://issues.apache.org/jira/browse/CAMEL-12615?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ] Zoran Regvart resolved CAMEL-12615. --- Resolution: Fixed Fix Version/s: 2.23.0 2.22.1 I opted to exclude the {{com.sun.java:tools}} brought in as transient dependency of {{net.openhft:chronicle-engine}} by {{net.openhft:lang}}. Not sure if this ends up breaking user code. If it does the users would need to redeclare this dependency or we would need to exclude {{camel-chronicle}} and {{camel-chronicle-starter}} from Java 9+ tests. See https://github.com/OpenHFT/Java-Lang/issues/83 > tools.jar missing in Java 9+ needed by camel-chronicle-starter > -- > > Key: CAMEL-12615 > URL: https://issues.apache.org/jira/browse/CAMEL-12615 > Project: Camel > Issue Type: Sub-task > Components: camel-chronicle, camel-spring-boot-starters >Reporter: Zoran Regvart >Assignee: Zoran Regvart >Priority: Major > Fix For: 2.22.1, 2.23.0 > > > An error in the daily build: > {code} > [ERROR] Failed to execute goal on project camel-chronicle-starter: Could not > resolve dependencies for project > org.apache.camel:camel-chronicle-starter:jar:2.22.0-SNAPSHOT: Could not find > artifact com.sun.java:tools:jar:9.0.1 at specified path > /usr/local/asfpackages/java/jdk-9.0.1/../lib/tools.jar -> [Help 2] > org.apache.maven.lifecycle.LifecycleExecutionException: Failed to execute > goal on project camel-chronicle-starter: Could not resolve dependencies for > project org.apache.camel:camel-chronicle-starter:jar:2.22.0-SNAPSHOT: Could > not find artifact com.sun.java:tools:jar:9.0.1 at specified path > /usr/local/asfpackages/java/jdk-9.0.1/../lib/tools.jar > {code} -- This message was sent by Atlassian JIRA (v7.6.3#76005)
[jira] [Updated] (CAMEL-12614) Missing javax.xml.bind.DatatypeConverter in camel-asn1 on Java 9+
[ https://issues.apache.org/jira/browse/CAMEL-12614?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ] Zoran Regvart updated CAMEL-12614: -- Fix Version/s: 2.23.0 2.22.1 > Missing javax.xml.bind.DatatypeConverter in camel-asn1 on Java 9+ > - > > Key: CAMEL-12614 > URL: https://issues.apache.org/jira/browse/CAMEL-12614 > Project: Camel > Issue Type: Sub-task >Reporter: Zoran Regvart >Assignee: Zoran Regvart >Priority: Major > Fix For: 2.22.1, 2.23.0 > > > I think the best solution would be to provide jaxb-api and jaxb-impl > dependencies in Java 9+ profile in camel-asn1. > Some work on that was already done in CAMEL-11850. -- This message was sent by Atlassian JIRA (v7.6.3#76005)
[jira] [Updated] (CAMEL-12616) Disable or remove camel-example-ceylon
[ https://issues.apache.org/jira/browse/CAMEL-12616?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ] Zoran Regvart updated CAMEL-12616: -- Fix Version/s: 2.23.0 2.22.1 > Disable or remove camel-example-ceylon > -- > > Key: CAMEL-12616 > URL: https://issues.apache.org/jira/browse/CAMEL-12616 > Project: Camel > Issue Type: Sub-task > Components: examples >Reporter: Zoran Regvart >Assignee: Zoran Regvart >Priority: Major > Fix For: 2.22.1, 2.23.0 > > > The ceylon-maven-example with the [fix to run on JDK > 9+|https://github.com/ceylon/ceylon-maven-plugin/commit/4e890f3ed6bfbc9b14560a094200a1b88e782f7e] > was not released for some time and it's causing issues in the > camel-example-ceylon. > We should delete this example or remove it from examples module in Java 9+ > profile > {code} > [ERROR] Failed to execute goal > org.ceylon-lang:ceylon-maven-plugin:1.3.3:compile (compile) on project > camel-example-ceylon: Execution compile of goal > org.ceylon-lang:ceylon-maven-plugin:1.3.3:compile failed: invalid source > release: 0 -> [Help 3] > org.apache.maven.lifecycle.LifecycleExecutionException: Failed to execute > goal org.ceylon-lang:ceylon-maven-plugin:1.3.3:compile (compile) on project > camel-example-ceylon: Execution compile of goal > org.ceylon-lang:ceylon-maven-plugin:1.3.3:compile failed: invalid source > release: 0 > {code} -- This message was sent by Atlassian JIRA (v7.6.3#76005)
[jira] [Assigned] (CAMEL-12615) tools.jar missing in Java 9+ needed by camel-chronicle-starter
[ https://issues.apache.org/jira/browse/CAMEL-12615?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ] Zoran Regvart reassigned CAMEL-12615: - Assignee: Zoran Regvart > tools.jar missing in Java 9+ needed by camel-chronicle-starter > -- > > Key: CAMEL-12615 > URL: https://issues.apache.org/jira/browse/CAMEL-12615 > Project: Camel > Issue Type: Sub-task > Components: camel-chronicle, camel-spring-boot-starters >Reporter: Zoran Regvart >Assignee: Zoran Regvart >Priority: Major > > An error in the daily build: > {code} > [ERROR] Failed to execute goal on project camel-chronicle-starter: Could not > resolve dependencies for project > org.apache.camel:camel-chronicle-starter:jar:2.22.0-SNAPSHOT: Could not find > artifact com.sun.java:tools:jar:9.0.1 at specified path > /usr/local/asfpackages/java/jdk-9.0.1/../lib/tools.jar -> [Help 2] > org.apache.maven.lifecycle.LifecycleExecutionException: Failed to execute > goal on project camel-chronicle-starter: Could not resolve dependencies for > project org.apache.camel:camel-chronicle-starter:jar:2.22.0-SNAPSHOT: Could > not find artifact com.sun.java:tools:jar:9.0.1 at specified path > /usr/local/asfpackages/java/jdk-9.0.1/../lib/tools.jar > {code} -- This message was sent by Atlassian JIRA (v7.6.3#76005)
[jira] [Work started] (CAMEL-12615) tools.jar missing in Java 9+ needed by camel-chronicle-starter
[ https://issues.apache.org/jira/browse/CAMEL-12615?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ] Work on CAMEL-12615 started by Zoran Regvart. - > tools.jar missing in Java 9+ needed by camel-chronicle-starter > -- > > Key: CAMEL-12615 > URL: https://issues.apache.org/jira/browse/CAMEL-12615 > Project: Camel > Issue Type: Sub-task > Components: camel-chronicle, camel-spring-boot-starters >Reporter: Zoran Regvart >Assignee: Zoran Regvart >Priority: Major > > An error in the daily build: > {code} > [ERROR] Failed to execute goal on project camel-chronicle-starter: Could not > resolve dependencies for project > org.apache.camel:camel-chronicle-starter:jar:2.22.0-SNAPSHOT: Could not find > artifact com.sun.java:tools:jar:9.0.1 at specified path > /usr/local/asfpackages/java/jdk-9.0.1/../lib/tools.jar -> [Help 2] > org.apache.maven.lifecycle.LifecycleExecutionException: Failed to execute > goal on project camel-chronicle-starter: Could not resolve dependencies for > project org.apache.camel:camel-chronicle-starter:jar:2.22.0-SNAPSHOT: Could > not find artifact com.sun.java:tools:jar:9.0.1 at specified path > /usr/local/asfpackages/java/jdk-9.0.1/../lib/tools.jar > {code} -- This message was sent by Atlassian JIRA (v7.6.3#76005)
[jira] [Assigned] (CAMEL-12616) Disable or remove camel-example-ceylon
[ https://issues.apache.org/jira/browse/CAMEL-12616?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ] Zoran Regvart reassigned CAMEL-12616: - Assignee: Zoran Regvart > Disable or remove camel-example-ceylon > -- > > Key: CAMEL-12616 > URL: https://issues.apache.org/jira/browse/CAMEL-12616 > Project: Camel > Issue Type: Sub-task > Components: examples >Reporter: Zoran Regvart >Assignee: Zoran Regvart >Priority: Major > > The ceylon-maven-example with the [fix to run on JDK > 9+|https://github.com/ceylon/ceylon-maven-plugin/commit/4e890f3ed6bfbc9b14560a094200a1b88e782f7e] > was not released for some time and it's causing issues in the > camel-example-ceylon. > We should delete this example or remove it from examples module in Java 9+ > profile > {code} > [ERROR] Failed to execute goal > org.ceylon-lang:ceylon-maven-plugin:1.3.3:compile (compile) on project > camel-example-ceylon: Execution compile of goal > org.ceylon-lang:ceylon-maven-plugin:1.3.3:compile failed: invalid source > release: 0 -> [Help 3] > org.apache.maven.lifecycle.LifecycleExecutionException: Failed to execute > goal org.ceylon-lang:ceylon-maven-plugin:1.3.3:compile (compile) on project > camel-example-ceylon: Execution compile of goal > org.ceylon-lang:ceylon-maven-plugin:1.3.3:compile failed: invalid source > release: 0 > {code} -- This message was sent by Atlassian JIRA (v7.6.3#76005)
[jira] [Resolved] (CAMEL-12616) Disable or remove camel-example-ceylon
[ https://issues.apache.org/jira/browse/CAMEL-12616?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ] Zoran Regvart resolved CAMEL-12616. --- Resolution: Fixed Opted to remove the example. It causes too much maintenance for us. Really sorry about this outcome. > Disable or remove camel-example-ceylon > -- > > Key: CAMEL-12616 > URL: https://issues.apache.org/jira/browse/CAMEL-12616 > Project: Camel > Issue Type: Sub-task > Components: examples >Reporter: Zoran Regvart >Priority: Major > > The ceylon-maven-example with the [fix to run on JDK > 9+|https://github.com/ceylon/ceylon-maven-plugin/commit/4e890f3ed6bfbc9b14560a094200a1b88e782f7e] > was not released for some time and it's causing issues in the > camel-example-ceylon. > We should delete this example or remove it from examples module in Java 9+ > profile > {code} > [ERROR] Failed to execute goal > org.ceylon-lang:ceylon-maven-plugin:1.3.3:compile (compile) on project > camel-example-ceylon: Execution compile of goal > org.ceylon-lang:ceylon-maven-plugin:1.3.3:compile failed: invalid source > release: 0 -> [Help 3] > org.apache.maven.lifecycle.LifecycleExecutionException: Failed to execute > goal org.ceylon-lang:ceylon-maven-plugin:1.3.3:compile (compile) on project > camel-example-ceylon: Execution compile of goal > org.ceylon-lang:ceylon-maven-plugin:1.3.3:compile failed: invalid source > release: 0 > {code} -- This message was sent by Atlassian JIRA (v7.6.3#76005)
[jira] [Resolved] (CAMEL-12614) Missing javax.xml.bind.DatatypeConverter in camel-asn1 on Java 9+
[ https://issues.apache.org/jira/browse/CAMEL-12614?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ] Zoran Regvart resolved CAMEL-12614. --- Resolution: Fixed This needed a bit of tinkering to get it to work. The issue was that the ASN1 compiler invoked by {{exec-maven-plugin}} depended on {{javax.xml.bind.DatatypeConverter}} class and changing it's classpath proved to challenging. Just adding the {{jaxb-impl}} dependency to the {{exec-maven-plugin}} resulted in {{NullPointerException}}, and only other alternative was to change the goal from {{java}} to {{exec}} and add {{jasn1-compiler}} and {{jaxb-api}} as dependencies of the module -- not plugin as the {{exec-maven-plugin}} doesn't support adding dependencies via {{pluginDependencies}}. > Missing javax.xml.bind.DatatypeConverter in camel-asn1 on Java 9+ > - > > Key: CAMEL-12614 > URL: https://issues.apache.org/jira/browse/CAMEL-12614 > Project: Camel > Issue Type: Sub-task >Reporter: Zoran Regvart >Assignee: Zoran Regvart >Priority: Major > > I think the best solution would be to provide jaxb-api and jaxb-impl > dependencies in Java 9+ profile in camel-asn1. > Some work on that was already done in CAMEL-11850. -- This message was sent by Atlassian JIRA (v7.6.3#76005)
[jira] [Commented] (CAMEL-11675) @Metadata should be repeatable
[ https://issues.apache.org/jira/browse/CAMEL-11675?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16531282#comment-16531282 ] ASF GitHub Bot commented on CAMEL-11675: davsclaus commented on a change in pull request #2391: CAMEL-11675 - Repetable @Metadata annotation and amend apt for tooling URL: https://github.com/apache/camel/pull/2391#discussion_r199783973 ## File path: tooling/apt/src/main/java/org/apache/camel/tools/apt/EndpointAnnotationProcessor.java ## @@ -359,12 +359,22 @@ protected ComponentModel findComponentProperties(RoundEnvironment roundEnv, UriE model.setLenientProperties(uriEndpoint.lenientProperties()); model.setAsync(implementsInterface(processingEnv, roundEnv, endpointClassElement, "org.apache.camel.AsyncEndpoint")); +String deprecationNote = null; // what is the first version this component was added to Apache Camel String firstVersion = uriEndpoint.firstVersion(); -if (Strings.isNullOrEmpty(firstVersion) && endpointClassElement.getAnnotation(Metadata.class) != null) { -// fallback to @Metadata if not from @UriEndpoint -firstVersion = endpointClassElement.getAnnotation(Metadata.class).firstVersion(); +Metadata[] metadataArray = endpointClassElement.getAnnotationsByType(Metadata.class); +for(Metadata metadata : metadataArray) { Review comment: code formatting looks like a checkstyle problem here This is an automated message from the Apache Git Service. To respond to the message, please log on GitHub and use the URL above to go to the specific comment. For queries about this service, please contact Infrastructure at: us...@infra.apache.org > @Metadata should be repeatable > -- > > Key: CAMEL-11675 > URL: https://issues.apache.org/jira/browse/CAMEL-11675 > Project: Camel > Issue Type: Improvement > Components: camel-core >Reporter: Luca Burgazzoli >Priority: Minor > Fix For: 2.23.0 > > > As today @Metadata is not repeatable so it is not easy to add multiple > information to i.e. a component, it would be nice to write something like: > {code:java} > @Metadata(key = "platforms", enums = { "spring", "spring-boot", "osgi" }) > @Metadata(key = "extensions", types = { MyExtension.cass }) > class MyComponent extends DefaultComponent { > } > {code} -- This message was sent by Atlassian JIRA (v7.6.3#76005)
[jira] [Commented] (CAMEL-11675) @Metadata should be repeatable
[ https://issues.apache.org/jira/browse/CAMEL-11675?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16531281#comment-16531281 ] ASF GitHub Bot commented on CAMEL-11675: davsclaus commented on a change in pull request #2391: CAMEL-11675 - Repetable @Metadata annotation and amend apt for tooling URL: https://github.com/apache/camel/pull/2391#discussion_r199783865 ## File path: tooling/apt/src/main/java/org/apache/camel/tools/apt/CoreEipAnnotationProcessor.java ## @@ -219,8 +219,8 @@ protected EipModel findEipModelProperties(ProcessingEnvironment processingEnv, R boolean deprecated = classElement.getAnnotation(Deprecated.class) != null; model.setDeprecated(deprecated); -Metadata metadata = classElement.getAnnotation(Metadata.class); -if (metadata != null) { +Metadata[] metadataArray = classElement.getAnnotationsByType(Metadata.class); +for (Metadata metadata : metadataArray) { Review comment: I dont think we should just loop and override the label, eg we should get the metadata annotation that has no `key` set as that is what is used for components today. Or it should grab the first that is not empty. This is an automated message from the Apache Git Service. To respond to the message, please log on GitHub and use the URL above to go to the specific comment. For queries about this service, please contact Infrastructure at: us...@infra.apache.org > @Metadata should be repeatable > -- > > Key: CAMEL-11675 > URL: https://issues.apache.org/jira/browse/CAMEL-11675 > Project: Camel > Issue Type: Improvement > Components: camel-core >Reporter: Luca Burgazzoli >Priority: Minor > Fix For: 2.23.0 > > > As today @Metadata is not repeatable so it is not easy to add multiple > information to i.e. a component, it would be nice to write something like: > {code:java} > @Metadata(key = "platforms", enums = { "spring", "spring-boot", "osgi" }) > @Metadata(key = "extensions", types = { MyExtension.cass }) > class MyComponent extends DefaultComponent { > } > {code} -- This message was sent by Atlassian JIRA (v7.6.3#76005)
[jira] [Commented] (CAMEL-11675) @Metadata should be repeatable
[ https://issues.apache.org/jira/browse/CAMEL-11675?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16531276#comment-16531276 ] ASF GitHub Bot commented on CAMEL-11675: davsclaus commented on issue #2391: CAMEL-11675 - Repetable @Metadata annotation and amend apt for tooling URL: https://github.com/apache/camel/pull/2391#issuecomment-402134226 Does this not require to have a key or some id like attribute on `@Metadata` as in the JIRA ticket? Also the apt plugin should favour the metadata that has no value set in key, as that is what its using by default for all the component json data stuff it does, eg This is an automated message from the Apache Git Service. To respond to the message, please log on GitHub and use the URL above to go to the specific comment. For queries about this service, please contact Infrastructure at: us...@infra.apache.org > @Metadata should be repeatable > -- > > Key: CAMEL-11675 > URL: https://issues.apache.org/jira/browse/CAMEL-11675 > Project: Camel > Issue Type: Improvement > Components: camel-core >Reporter: Luca Burgazzoli >Priority: Minor > Fix For: 2.23.0 > > > As today @Metadata is not repeatable so it is not easy to add multiple > information to i.e. a component, it would be nice to write something like: > {code:java} > @Metadata(key = "platforms", enums = { "spring", "spring-boot", "osgi" }) > @Metadata(key = "extensions", types = { MyExtension.cass }) > class MyComponent extends DefaultComponent { > } > {code} -- This message was sent by Atlassian JIRA (v7.6.3#76005)
[jira] [Commented] (CAMEL-11675) @Metadata should be repeatable
[ https://issues.apache.org/jira/browse/CAMEL-11675?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16531271#comment-16531271 ] ASF GitHub Bot commented on CAMEL-11675: davsclaus commented on issue #2391: CAMEL-11675 - Repetable @Metadata annotation and amend apt for tooling URL: https://github.com/apache/camel/pull/2391#issuecomment-402133503 Is the checkstyle correct, it looks a bit as if there are too many spaces / tabs This is an automated message from the Apache Git Service. To respond to the message, please log on GitHub and use the URL above to go to the specific comment. For queries about this service, please contact Infrastructure at: us...@infra.apache.org > @Metadata should be repeatable > -- > > Key: CAMEL-11675 > URL: https://issues.apache.org/jira/browse/CAMEL-11675 > Project: Camel > Issue Type: Improvement > Components: camel-core >Reporter: Luca Burgazzoli >Priority: Minor > Fix For: 2.23.0 > > > As today @Metadata is not repeatable so it is not easy to add multiple > information to i.e. a component, it would be nice to write something like: > {code:java} > @Metadata(key = "platforms", enums = { "spring", "spring-boot", "osgi" }) > @Metadata(key = "extensions", types = { MyExtension.cass }) > class MyComponent extends DefaultComponent { > } > {code} -- This message was sent by Atlassian JIRA (v7.6.3#76005)
[jira] [Commented] (CAMEL-12603) Thread stuck in re-delivery loop after interrupting it
[ https://issues.apache.org/jira/browse/CAMEL-12603?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16531273#comment-16531273 ] ASF GitHub Bot commented on CAMEL-12603: dmvolod commented on a change in pull request #2396: CAMEL-12603 - Interrupt fix for messages stuck in a re-delivery loop URL: https://github.com/apache/camel/pull/2396#discussion_r199783067 ## File path: camel-core/src/test/java/org/apache/camel/processor/async/AsyncProcessorAwaitManagerInterruptWithRedeliveryTest.java ## @@ -0,0 +1,136 @@ +/** + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed with + * this work for additional information regarding copyright ownership. + * The ASF licenses this file to You under the Apache License, Version 2.0 + * (the "License"); you may not use this file except in compliance with + * the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package org.apache.camel.processor.async; + +import org.apache.camel.CamelExecutionException; +import org.apache.camel.ContextTestSupport; +import org.apache.camel.builder.RouteBuilder; +import org.apache.camel.spi.AsyncProcessorAwaitManager; +import org.apache.camel.util.jndi.JndiContext; + +import javax.naming.Context; +import java.util.Collection; +import java.util.concurrent.CountDownLatch; +import java.util.concurrent.RejectedExecutionException; +import java.util.concurrent.TimeUnit; + +import static org.mockito.Mockito.atMost; +import static org.mockito.Mockito.spy; +import static org.mockito.Mockito.verify; + +public class AsyncProcessorAwaitManagerInterruptWithRedeliveryTest extends ContextTestSupport { +private CountDownLatch latch; +private MyBean bean; + +@Override +protected void setUp() throws Exception { +latch = new CountDownLatch(2); +bean = spy(new MyBean(latch)); +super.setUp(); +} + +public void testAsyncAwaitInterrupt() throws Exception { + context.getAsyncProcessorAwaitManager().getStatistics().setStatisticsEnabled(true); + +assertEquals(0, context.getAsyncProcessorAwaitManager().size()); + +getMockEndpoint("mock:before").expectedBodiesReceived("Hello Camel"); +getMockEndpoint("mock:result").expectedMessageCount(0); +getMockEndpoint("mock:error").expectedMessageCount(0); + +createThreadToInterrupt(); +try { +template.sendBody("direct:start", "Hello Camel"); +fail("Should throw exception"); +} catch (CamelExecutionException e) { +RejectedExecutionException cause = assertIsInstanceOf(RejectedExecutionException.class, e.getCause()); +assertTrue(cause.getMessage().startsWith("Interrupted while waiting for asynchronous callback")); +} + +assertMockEndpointsSatisfied(); + +// Check we have not reached the full 5 re-deliveries +verify(bean, atMost(4)).callMe(); + +assertEquals(0, context.getAsyncProcessorAwaitManager().size()); +assertEquals(1, context.getAsyncProcessorAwaitManager().getStatistics().getThreadsBlocked()); +assertEquals(1, context.getAsyncProcessorAwaitManager().getStatistics().getThreadsInterrupted()); +} + +private void createThreadToInterrupt() { +new Thread(() -> { +// Allow some time for camel exchange to enter the re-deliveries +try { +latch.await(1, TimeUnit.SECONDS); +} catch (InterruptedException e) { +e.printStackTrace(); +} + +// Get our blocked thread +int size = context.getAsyncProcessorAwaitManager().size(); +System.out.println("In-flight messages: " + size); Review comment: Please avoid using System.out.println if it's not required for use-case. Use logs for it. This is an automated message from the Apache Git Service. To respond to the message, please log on GitHub and use the URL above to go to the specific comment. For queries about this service, please contact Infrastructure at: us...@infra.apache.org > Thread stuck in re-delivery loop after interrupting it > -- > > Key: CAMEL-12603 > URL: https://issues.apache.org/jira/browse/CAMEL-12603 > Project: Camel > Issue Type: Bug > Components: camel-core >
[jira] [Updated] (CAMEL-12603) Thread stuck in re-delivery loop after interrupting it
[ https://issues.apache.org/jira/browse/CAMEL-12603?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ] Claus Ibsen updated CAMEL-12603: Fix Version/s: 2.23.0 2.22.1 2.21.2 > Thread stuck in re-delivery loop after interrupting it > -- > > Key: CAMEL-12603 > URL: https://issues.apache.org/jira/browse/CAMEL-12603 > Project: Camel > Issue Type: Bug > Components: camel-core >Reporter: Nick Horne >Priority: Major > Fix For: 2.21.2, 2.22.1, 2.23.0 > > > I have experienced an issue where we could not cancel a message stuck in a > re-delivery cycle. I was using Jolokia and calling the interrupt method on > the DefaultAsyncProcessorAwaitManager for the blocked exchange and I had > expected the re-delivery cycle to stop. > This does not happen, and the blocked message continues to get executed and > re-delivered. The mapping does get removed from the in-flight messages > though. I can see also that the RejectedExecutionException set by the > interrupt is also overwritten by the exception thrown by our failing bean. I > think the problem here is that there are no checks for this > RejectedExecutionException during the re-delivery cycle. > It seems like the following part of the RedeliveryErrorHandler::call should > pick up the fact that the exchange has been interrupted: > {code:java} > // only process if the exchange hasn't failed > // and it has not been handled by the error processor > if (isDone(exchange)) { > callback.done(false); > return; > }{code} > This is an issue if you have configured a long re-delivery cycle and you have > a message retrying that you know will never succeed. -- This message was sent by Atlassian JIRA (v7.6.3#76005)
[jira] [Commented] (CAMEL-12603) Thread stuck in re-delivery loop after interrupting it
[ https://issues.apache.org/jira/browse/CAMEL-12603?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16531262#comment-16531262 ] ASF GitHub Bot commented on CAMEL-12603: davsclaus commented on issue #2396: CAMEL-12603 - Interrupt fix for messages stuck in a re-delivery loop URL: https://github.com/apache/camel/pull/2396#issuecomment-402132134 Lets wait to merge this until we get the 2.22.x branch This is an automated message from the Apache Git Service. To respond to the message, please log on GitHub and use the URL above to go to the specific comment. For queries about this service, please contact Infrastructure at: us...@infra.apache.org > Thread stuck in re-delivery loop after interrupting it > -- > > Key: CAMEL-12603 > URL: https://issues.apache.org/jira/browse/CAMEL-12603 > Project: Camel > Issue Type: Bug > Components: camel-core >Reporter: Nick Horne >Priority: Major > Fix For: 2.21.2, 2.22.1, 2.23.0 > > > I have experienced an issue where we could not cancel a message stuck in a > re-delivery cycle. I was using Jolokia and calling the interrupt method on > the DefaultAsyncProcessorAwaitManager for the blocked exchange and I had > expected the re-delivery cycle to stop. > This does not happen, and the blocked message continues to get executed and > re-delivered. The mapping does get removed from the in-flight messages > though. I can see also that the RejectedExecutionException set by the > interrupt is also overwritten by the exception thrown by our failing bean. I > think the problem here is that there are no checks for this > RejectedExecutionException during the re-delivery cycle. > It seems like the following part of the RedeliveryErrorHandler::call should > pick up the fact that the exchange has been interrupted: > {code:java} > // only process if the exchange hasn't failed > // and it has not been handled by the error processor > if (isDone(exchange)) { > callback.done(false); > return; > }{code} > This is an issue if you have configured a long re-delivery cycle and you have > a message retrying that you know will never succeed. -- This message was sent by Atlassian JIRA (v7.6.3#76005)
[jira] [Commented] (CAMEL-12504) Test Apache Camel on Java 9 and newer
[ https://issues.apache.org/jira/browse/CAMEL-12504?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16531215#comment-16531215 ] Colm O hEigeartaigh commented on CAMEL-12504: - CustomSchemaFactoryFeatureTest is failing on Java 10. It looks like this test never worked as expected: String jdkVendor = System.getProperty("java.vm.vendor"); if (jdkVendor != null && (jdkVendor.indexOf("Oracle") > 0 || jdkVendor.indexOf("Sun") > 0)) { fail("Expect exception here"); } I think the intention here is to "fail" with the Oracle JDK if an exception is not thrown - but jdkVendor.indexOf("Oracle") returns 0 for Java 7/8, so the test never actually failed (no exception is thrown). It returns "1" for Java 10, as the Java vendor is now enclosed in quotation marks. > Test Apache Camel on Java 9 and newer > - > > Key: CAMEL-12504 > URL: https://issues.apache.org/jira/browse/CAMEL-12504 > Project: Camel > Issue Type: Test > Components: build system >Reporter: Luca Burgazzoli >Priority: Major > Fix For: 2.23.0 > > -- This message was sent by Atlassian JIRA (v7.6.3#76005)
[jira] [Created] (CAMEL-12619) camel-swagger-java - Add support for 3.0 spec
Claus Ibsen created CAMEL-12619: --- Summary: camel-swagger-java - Add support for 3.0 spec Key: CAMEL-12619 URL: https://issues.apache.org/jira/browse/CAMEL-12619 Project: Camel Issue Type: New Feature Components: camel-swagger Reporter: Claus Ibsen Not sure if we can make swagger v3 generate v2 spec files, so we can be 100% backwards compatible. But v3 openapi 3.0 spec is a different maven GAV so its maybe not an easy upgrade. -- This message was sent by Atlassian JIRA (v7.6.3#76005)
[jira] [Work started] (CAMEL-12614) Missing javax.xml.bind.DatatypeConverter in camel-asn1 on Java 9+
[ https://issues.apache.org/jira/browse/CAMEL-12614?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ] Work on CAMEL-12614 started by Zoran Regvart. - > Missing javax.xml.bind.DatatypeConverter in camel-asn1 on Java 9+ > - > > Key: CAMEL-12614 > URL: https://issues.apache.org/jira/browse/CAMEL-12614 > Project: Camel > Issue Type: Sub-task >Reporter: Zoran Regvart >Assignee: Zoran Regvart >Priority: Major > > I think the best solution would be to provide jaxb-api and jaxb-impl > dependencies in Java 9+ profile in camel-asn1. > Some work on that was already done in CAMEL-11850. -- This message was sent by Atlassian JIRA (v7.6.3#76005)
[jira] [Created] (CAMEL-12618) Compilation failure on Java 11
Zoran Regvart created CAMEL-12618: - Summary: Compilation failure on Java 11 Key: CAMEL-12618 URL: https://issues.apache.org/jira/browse/CAMEL-12618 Project: Camel Issue Type: Sub-task Components: build system Reporter: Zoran Regvart Maven compiler fails on JDK 11 for us. The error is not that helpful. {code} [ERROR] Failed to execute goal org.apache.maven.plugins:maven-compiler-plugin:3.7.0:compile (default-compile) on project json-simple-ordered: Compilation failure -> [Help 1] org.apache.maven.lifecycle.LifecycleExecutionException: Failed to execute goal org.apache.maven.plugins:maven-compiler-plugin:3.7.0:compile (default-compile) on project json-simple-ordered: Compilation failure {code} -- This message was sent by Atlassian JIRA (v7.6.3#76005)
[jira] [Assigned] (CAMEL-12614) Missing javax.xml.bind.DatatypeConverter in camel-asn1 on Java 9+
[ https://issues.apache.org/jira/browse/CAMEL-12614?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ] Zoran Regvart reassigned CAMEL-12614: - Assignee: Zoran Regvart > Missing javax.xml.bind.DatatypeConverter in camel-asn1 on Java 9+ > - > > Key: CAMEL-12614 > URL: https://issues.apache.org/jira/browse/CAMEL-12614 > Project: Camel > Issue Type: Sub-task >Reporter: Zoran Regvart >Assignee: Zoran Regvart >Priority: Major > > I think the best solution would be to provide jaxb-api and jaxb-impl > dependencies in Java 9+ profile in camel-asn1. > Some work on that was already done in CAMEL-11850. -- This message was sent by Atlassian JIRA (v7.6.3#76005)
[jira] [Commented] (CAMEL-12504) Test Apache Camel on Java 9 and newer
[ https://issues.apache.org/jira/browse/CAMEL-12504?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16531155#comment-16531155 ] Colm O hEigeartaigh commented on CAMEL-12504: - I pushed a fix for the failing RestDslXmlGeneratorTest on Java 9. > Test Apache Camel on Java 9 and newer > - > > Key: CAMEL-12504 > URL: https://issues.apache.org/jira/browse/CAMEL-12504 > Project: Camel > Issue Type: Test > Components: build system >Reporter: Luca Burgazzoli >Priority: Major > Fix For: 2.23.0 > > -- This message was sent by Atlassian JIRA (v7.6.3#76005)
[jira] [Created] (CAMEL-12617) Upgrade ASM to 6.1 or newer
Zoran Regvart created CAMEL-12617: - Summary: Upgrade ASM to 6.1 or newer Key: CAMEL-12617 URL: https://issues.apache.org/jira/browse/CAMEL-12617 Project: Camel Issue Type: Sub-task Components: camel-package-maven-plugin Reporter: Zoran Regvart ASM 6.1 brings in Java 10 support, 6.2 has experimental Java 11 support. camel-package-maven-plugin ASM issue on JDK 10 from the daily build: {code} org.apache.maven.lifecycle.LifecycleExecutionException: Failed to execute goal org.apache.camel:camel-package-maven-plugin:2.22.0-SNAPSHOT:prepare-readme (default) on project camel-catalog: Execution default of goal org.apache.camel:camel-package-maven-plugin:2.22.0-SNAPSHOT:prepare-readme failed: An API incompatibility was encountered while executing org.apache.camel:camel-package-maven-plugin:2.22.0-SNAPSHOT:prepare-readme: java.lang.VerifyError: (class: ASMAccessorImpl_108379339615305901704587, method: getKnownEgressType signature: ()Ljava/lang/Class;) Illegal type in constant pool {code} -- This message was sent by Atlassian JIRA (v7.6.3#76005)
[jira] [Created] (CAMEL-12616) Disable or remove camel-example-ceylon
Zoran Regvart created CAMEL-12616: - Summary: Disable or remove camel-example-ceylon Key: CAMEL-12616 URL: https://issues.apache.org/jira/browse/CAMEL-12616 Project: Camel Issue Type: Sub-task Components: examples Reporter: Zoran Regvart The ceylon-maven-example with the [fix to run on JDK 9+|https://github.com/ceylon/ceylon-maven-plugin/commit/4e890f3ed6bfbc9b14560a094200a1b88e782f7e] was not released for some time and it's causing issues in the camel-example-ceylon. We should delete this example or remove it from examples module in Java 9+ profile {code} [ERROR] Failed to execute goal org.ceylon-lang:ceylon-maven-plugin:1.3.3:compile (compile) on project camel-example-ceylon: Execution compile of goal org.ceylon-lang:ceylon-maven-plugin:1.3.3:compile failed: invalid source release: 0 -> [Help 3] org.apache.maven.lifecycle.LifecycleExecutionException: Failed to execute goal org.ceylon-lang:ceylon-maven-plugin:1.3.3:compile (compile) on project camel-example-ceylon: Execution compile of goal org.ceylon-lang:ceylon-maven-plugin:1.3.3:compile failed: invalid source release: 0 {code} -- This message was sent by Atlassian JIRA (v7.6.3#76005)
[jira] [Created] (CAMEL-12615) tools.jar missing in Java 9+ needed by camel-chronicle-starter
Zoran Regvart created CAMEL-12615: - Summary: tools.jar missing in Java 9+ needed by camel-chronicle-starter Key: CAMEL-12615 URL: https://issues.apache.org/jira/browse/CAMEL-12615 Project: Camel Issue Type: Sub-task Components: camel-chronicle, camel-spring-boot-starters Reporter: Zoran Regvart An error in the daily build: {code} [ERROR] Failed to execute goal on project camel-chronicle-starter: Could not resolve dependencies for project org.apache.camel:camel-chronicle-starter:jar:2.22.0-SNAPSHOT: Could not find artifact com.sun.java:tools:jar:9.0.1 at specified path /usr/local/asfpackages/java/jdk-9.0.1/../lib/tools.jar -> [Help 2] org.apache.maven.lifecycle.LifecycleExecutionException: Failed to execute goal on project camel-chronicle-starter: Could not resolve dependencies for project org.apache.camel:camel-chronicle-starter:jar:2.22.0-SNAPSHOT: Could not find artifact com.sun.java:tools:jar:9.0.1 at specified path /usr/local/asfpackages/java/jdk-9.0.1/../lib/tools.jar {code} -- This message was sent by Atlassian JIRA (v7.6.3#76005)
[jira] [Created] (CAMEL-12614) Missing javax.xml.bind.DatatypeConverter in camel-asn1 on Java 9+
Zoran Regvart created CAMEL-12614: - Summary: Missing javax.xml.bind.DatatypeConverter in camel-asn1 on Java 9+ Key: CAMEL-12614 URL: https://issues.apache.org/jira/browse/CAMEL-12614 Project: Camel Issue Type: Sub-task Reporter: Zoran Regvart I think the best solution would be to provide jaxb-api and jaxb-impl dependencies in Java 9+ profile in camel-asn1. Some work on that was already done in CAMEL-11850. -- This message was sent by Atlassian JIRA (v7.6.3#76005)
[jira] [Commented] (CAMEL-12504) Test Apache Camel on Java 10
[ https://issues.apache.org/jira/browse/CAMEL-12504?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16531101#comment-16531101 ] Zoran Regvart commented on CAMEL-12504: --- Just a quick update on this: the [daily build|https://builds.apache.org/view/C/view/Apache%20Camel/job/Camel.daily/] builds on JDK 8 and then runs tests on JDK 9, 10 and 11. Latest change I made was to fail the build at the end if the Maven returns a non zero return code. There is a very small amount of tests that now fail on JDK 9 and 10 (17 in total) and two components have jigsaw related issues (classes missing), and the JDK 11 tests are not run as the maven-compiler-plugin version we use fails to compile in {{json-simple-ordered}}. I'll create sub tasks for the issues we currently have and rename this issue to say test on Java 9+. > Test Apache Camel on Java 10 > > > Key: CAMEL-12504 > URL: https://issues.apache.org/jira/browse/CAMEL-12504 > Project: Camel > Issue Type: Test > Components: build system >Reporter: Luca Burgazzoli >Priority: Major > Fix For: 2.23.0 > > -- This message was sent by Atlassian JIRA (v7.6.3#76005)
[jira] [Updated] (CAMEL-12504) Test Apache Camel on Java 9 and newer
[ https://issues.apache.org/jira/browse/CAMEL-12504?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ] Zoran Regvart updated CAMEL-12504: -- Summary: Test Apache Camel on Java 9 and newer (was: Test Apache Camel on Java 10) > Test Apache Camel on Java 9 and newer > - > > Key: CAMEL-12504 > URL: https://issues.apache.org/jira/browse/CAMEL-12504 > Project: Camel > Issue Type: Test > Components: build system >Reporter: Luca Burgazzoli >Priority: Major > Fix For: 2.23.0 > > -- This message was sent by Atlassian JIRA (v7.6.3#76005)
[jira] [Commented] (CAMEL-12607) When using Tokenizer skipFirst - java.util.NoSuchElementException if only one element
[ https://issues.apache.org/jira/browse/CAMEL-12607?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16531097#comment-16531097 ] Dmitry Volodin commented on CAMEL-12607: Waiting until camel-2.22.x branch will create > When using Tokenizer skipFirst - java.util.NoSuchElementException if only one > element > - > > Key: CAMEL-12607 > URL: https://issues.apache.org/jira/browse/CAMEL-12607 > Project: Camel > Issue Type: Bug > Components: camel-core >Affects Versions: 2.21.1 >Reporter: Sergey Savenko >Assignee: Dmitry Volodin >Priority: Minor > Fix For: 2.21.2, 2.22.1, 2.23.0 > > > I use {{.split().tokenize("\n", 1, true).streaming()}} to stream csv file > with header row and skip first line. > When file contains ONLY header row - {{java.util.NoSuchElementException}} is > thrown in > [https://github.com/apache/camel/blob/camel-2.21.1/camel-core/src/main/java/org/apache/camel/util/GroupTokenIterator.java#L158], > because when it skips first line - it does not check if it has next line and > just calls next(). -- This message was sent by Atlassian JIRA (v7.6.3#76005)
[jira] [Updated] (CAMEL-12607) When using Tokenizer skipFirst - java.util.NoSuchElementException if only one element
[ https://issues.apache.org/jira/browse/CAMEL-12607?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ] Dmitry Volodin updated CAMEL-12607: --- Fix Version/s: 2.23.0 2.22.1 2.21.2 > When using Tokenizer skipFirst - java.util.NoSuchElementException if only one > element > - > > Key: CAMEL-12607 > URL: https://issues.apache.org/jira/browse/CAMEL-12607 > Project: Camel > Issue Type: Bug > Components: camel-core >Affects Versions: 2.21.1 >Reporter: Sergey Savenko >Assignee: Dmitry Volodin >Priority: Minor > Fix For: 2.21.2, 2.22.1, 2.23.0 > > > I use {{.split().tokenize("\n", 1, true).streaming()}} to stream csv file > with header row and skip first line. > When file contains ONLY header row - {{java.util.NoSuchElementException}} is > thrown in > [https://github.com/apache/camel/blob/camel-2.21.1/camel-core/src/main/java/org/apache/camel/util/GroupTokenIterator.java#L158], > because when it skips first line - it does not check if it has next line and > just calls next(). -- This message was sent by Atlassian JIRA (v7.6.3#76005)
[jira] [Commented] (CAMEL-12607) When using Tokenizer skipFirst - java.util.NoSuchElementException if only one element
[ https://issues.apache.org/jira/browse/CAMEL-12607?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16531082#comment-16531082 ] ASF GitHub Bot commented on CAMEL-12607: Github user dmvolod closed the pull request at: https://github.com/apache/camel/pull/2402 > When using Tokenizer skipFirst - java.util.NoSuchElementException if only one > element > - > > Key: CAMEL-12607 > URL: https://issues.apache.org/jira/browse/CAMEL-12607 > Project: Camel > Issue Type: Bug > Components: camel-core >Affects Versions: 2.21.1 >Reporter: Sergey Savenko >Assignee: Dmitry Volodin >Priority: Minor > > I use {{.split().tokenize("\n", 1, true).streaming()}} to stream csv file > with header row and skip first line. > When file contains ONLY header row - {{java.util.NoSuchElementException}} is > thrown in > [https://github.com/apache/camel/blob/camel-2.21.1/camel-core/src/main/java/org/apache/camel/util/GroupTokenIterator.java#L158], > because when it skips first line - it does not check if it has next line and > just calls next(). -- This message was sent by Atlassian JIRA (v7.6.3#76005)
[jira] [Commented] (CAMEL-12607) When using Tokenizer skipFirst - java.util.NoSuchElementException if only one element
[ https://issues.apache.org/jira/browse/CAMEL-12607?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16531081#comment-16531081 ] ASF GitHub Bot commented on CAMEL-12607: dmvolod closed pull request #2402: CAMEL-12607: When using Tokenizer skipFirst java.util.NoSuchElementException if only one element [will merge after 2.22.0 release] URL: https://github.com/apache/camel/pull/2402 This is a PR merged from a forked repository. As GitHub hides the original diff on merge, it is displayed below for the sake of provenance: As this is a foreign pull request (from a fork), the diff is supplied below (as it won't show otherwise due to GitHub magic): diff --git a/camel-core/src/main/java/org/apache/camel/util/GroupTokenIterator.java b/camel-core/src/main/java/org/apache/camel/util/GroupTokenIterator.java index 0bfd2689a4b..2f05116d8f0 100644 --- a/camel-core/src/main/java/org/apache/camel/util/GroupTokenIterator.java +++ b/camel-core/src/main/java/org/apache/camel/util/GroupTokenIterator.java @@ -50,7 +50,7 @@ private final ByteArrayOutputStream bos = new ByteArrayOutputStream(); /** - * Creates a new token based group titerator + * Creates a new token based group iterator * * @param camelContext the camel context * @param itthe iterator to group @@ -155,7 +155,12 @@ private Object doNext() throws IOException, NoTypeConversionAvailableException { data = it.next(); if (skipFirst && hasSkipFirst.compareAndSet(false, true)) { -data = it.next(); +if (it.hasNext()) { +data = it.next(); +} else { +// Content with header only which is marked to skip +data = ""; +} } // include token in between diff --git a/camel-core/src/test/java/org/apache/camel/processor/SplitGroupSkipFirstTest.java b/camel-core/src/test/java/org/apache/camel/processor/SplitGroupSkipFirstTest.java index d85cac27c21..5c09847c27e 100644 --- a/camel-core/src/test/java/org/apache/camel/processor/SplitGroupSkipFirstTest.java +++ b/camel-core/src/test/java/org/apache/camel/processor/SplitGroupSkipFirstTest.java @@ -31,6 +31,14 @@ public void testSplitSkipFirst() throws Exception { assertMockEndpointsSatisfied(); } + +public void testSplitSkipFirstOnlyHeader() throws Exception { +getMockEndpoint("mock:group").expectedBodiesReceived(""); + +template.sendBody("direct:start", "##comment\n"); + +assertMockEndpointsSatisfied(); +} @Override protected RouteBuilder createRouteBuilder() throws Exception { This is an automated message from the Apache Git Service. To respond to the message, please log on GitHub and use the URL above to go to the specific comment. For queries about this service, please contact Infrastructure at: us...@infra.apache.org > When using Tokenizer skipFirst - java.util.NoSuchElementException if only one > element > - > > Key: CAMEL-12607 > URL: https://issues.apache.org/jira/browse/CAMEL-12607 > Project: Camel > Issue Type: Bug > Components: camel-core >Affects Versions: 2.21.1 >Reporter: Sergey Savenko >Assignee: Dmitry Volodin >Priority: Minor > > I use {{.split().tokenize("\n", 1, true).streaming()}} to stream csv file > with header row and skip first line. > When file contains ONLY header row - {{java.util.NoSuchElementException}} is > thrown in > [https://github.com/apache/camel/blob/camel-2.21.1/camel-core/src/main/java/org/apache/camel/util/GroupTokenIterator.java#L158], > because when it skips first line - it does not check if it has next line and > just calls next(). -- This message was sent by Atlassian JIRA (v7.6.3#76005)
[jira] [Commented] (CAMEL-12607) When using Tokenizer skipFirst - java.util.NoSuchElementException if only one element
[ https://issues.apache.org/jira/browse/CAMEL-12607?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16531080#comment-16531080 ] ASF GitHub Bot commented on CAMEL-12607: dmvolod commented on issue #2402: CAMEL-12607: When using Tokenizer skipFirst java.util.NoSuchElementException if only one element [will merge after 2.22.0 release] URL: https://github.com/apache/camel/pull/2402#issuecomment-402073041 @oscerd , thanks, merged. This is an automated message from the Apache Git Service. To respond to the message, please log on GitHub and use the URL above to go to the specific comment. For queries about this service, please contact Infrastructure at: us...@infra.apache.org > When using Tokenizer skipFirst - java.util.NoSuchElementException if only one > element > - > > Key: CAMEL-12607 > URL: https://issues.apache.org/jira/browse/CAMEL-12607 > Project: Camel > Issue Type: Bug > Components: camel-core >Affects Versions: 2.21.1 >Reporter: Sergey Savenko >Assignee: Dmitry Volodin >Priority: Minor > > I use {{.split().tokenize("\n", 1, true).streaming()}} to stream csv file > with header row and skip first line. > When file contains ONLY header row - {{java.util.NoSuchElementException}} is > thrown in > [https://github.com/apache/camel/blob/camel-2.21.1/camel-core/src/main/java/org/apache/camel/util/GroupTokenIterator.java#L158], > because when it skips first line - it does not check if it has next line and > just calls next(). -- This message was sent by Atlassian JIRA (v7.6.3#76005)
[jira] [Commented] (CAMEL-12596) Camel-Kafka security protocol SASL_PLAINTEXT not supported
[ https://issues.apache.org/jira/browse/CAMEL-12596?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16531074#comment-16531074 ] Lizuca Mihaescu commented on CAMEL-12596: - Thank you both :). I am going to check the Red Hat to find someone. In the mean time I will try simpler setups, step by step as suggested. It is true I've tried to achieve to much :( Please keep this issue for further investigation. > Camel-Kafka security protocol SASL_PLAINTEXT not supported > -- > > Key: CAMEL-12596 > URL: https://issues.apache.org/jira/browse/CAMEL-12596 > Project: Camel > Issue Type: Improvement > Components: camel-kafka >Affects Versions: 2.21.1 > Environment: * ActiveMQ v5.15.4 > * Camel:2.21.1 > * Kafka Clients: 1.1.0 > * Server Version: Apache/2.4.6(CentOS) >Reporter: Lizuca Mihaescu >Priority: Major > Attachments: camel.xml, camel.xml > > > I need to route ActiveMQ messages to Kafka(Cloudera) through Camel using > authentication protocol Kerberos. > > Kafka Security documentation states that it only supports *SASL_PLAINTEXT* > and *SASL_SSL* for Kerberos: > [https://www.cloudera.com/documentation/kafka/2-0-x/topics/kafka_security.html] > > | ** |*SSL*|*Kerberos*| > |PLAINTEXT|No|No| > |SSL|Yes|No| > |SASL_PLAINTEXT|No|Yes| > |SASL_SSL|Yes|Yes| > > > > On the other hand when I try to use *SASL_PLAINTEXT* for security protocol in > Camel I am getting an error during the ActiveMQ starting. As a result > ActiveMQ will not start. > > I took the latest Camel code from: [https://github.com/apache/camel.git] and > it states that it only supports *SSL* and *PLAINTEXT* as security protocols > values. > > | *securityProtocol* (security) | Protocol used to communicate with brokers. > Currently only PLAINTEXT and SSL are supported. | PLAINTEXT | String > > > I did find this solved issue: [https://access.redhat.com/solutions/3364871] > but I did not find any evidence that this is working in the latest Camel > version. > > My Camel setup fragment is: > {code:java} > uri="kafka://10.100.70.00:9092?topic=MyEvents.s1.v1&brokers=10.100.70.00:9092&requestTimeoutMs=305000&retries=3&keySerializerClass=org.apache.kafka.common.serialization.ByteArraySerializer&saslMechanism=GSSAPI&serializerClass=org.apache.kafka.common.serialization.ByteArraySerializer&securityProtocol=SASL_PLAINTEXT&saslKerberosServiceName=kafka"/>{code} > > I am using an external Jaas configuration file: > {code:java} > KafkaClient { > com.sun.security.auth.module.Krb5LoginModule required > useKeyTab=true > storeKey=true > keyTab="./user.keytab" > useTicketCache=false > serviceName="kafka" > principal=" Group/u...@domain.lan"; > };{code} > Why Camel does not support *SASL_PLAINTEXT* *and* *SASL_SSL*? > > Please help me this is *VERY IMPORTANT* for the project I am working on and > this issue is considered a blocker. I am also an experienced Java programmer > and I am willing to contribute if necessary to the open source code for such > implementation if the need may be. -- This message was sent by Atlassian JIRA (v7.6.3#76005)
[jira] [Commented] (CAMEL-12607) When using Tokenizer skipFirst - java.util.NoSuchElementException if only one element
[ https://issues.apache.org/jira/browse/CAMEL-12607?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16531068#comment-16531068 ] ASF GitHub Bot commented on CAMEL-12607: oscerd commented on issue #2402: CAMEL-12607: When using Tokenizer skipFirst java.util.NoSuchElementException if only one element [will merge after 2.22.0 release] URL: https://github.com/apache/camel/pull/2402#issuecomment-402069131 You can merge it, I guess. This is an automated message from the Apache Git Service. To respond to the message, please log on GitHub and use the URL above to go to the specific comment. For queries about this service, please contact Infrastructure at: us...@infra.apache.org > When using Tokenizer skipFirst - java.util.NoSuchElementException if only one > element > - > > Key: CAMEL-12607 > URL: https://issues.apache.org/jira/browse/CAMEL-12607 > Project: Camel > Issue Type: Bug > Components: camel-core >Affects Versions: 2.21.1 >Reporter: Sergey Savenko >Assignee: Dmitry Volodin >Priority: Minor > > I use {{.split().tokenize("\n", 1, true).streaming()}} to stream csv file > with header row and skip first line. > When file contains ONLY header row - {{java.util.NoSuchElementException}} is > thrown in > [https://github.com/apache/camel/blob/camel-2.21.1/camel-core/src/main/java/org/apache/camel/util/GroupTokenIterator.java#L158], > because when it skips first line - it does not check if it has next line and > just calls next(). -- This message was sent by Atlassian JIRA (v7.6.3#76005)
[jira] [Commented] (CAMEL-12586) Use consistant Surefire and JAXB version
[ https://issues.apache.org/jira/browse/CAMEL-12586?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16531063#comment-16531063 ] Zoran Regvart commented on CAMEL-12586: --- [~ancosen] no I see no reason to, this only affects running tests on Java 9+. > Use consistant Surefire and JAXB version > > > Key: CAMEL-12586 > URL: https://issues.apache.org/jira/browse/CAMEL-12586 > Project: Camel > Issue Type: Task > Components: build system >Reporter: Zoran Regvart >Assignee: Zoran Regvart >Priority: Major > Fix For: 2.22.1 > > > Seems that our daily build fails as the {{maven-surefire-plugin}} configured > in JDK 9+ profile requires a version of {{jaxb-core}} that's no(t) (longer) > available on Maven Central. And with SUREFIRE-1330 in 2.22.0 it opens the use > of JUnit5 in Camel. > Might be worth taking a look and use the same {{maven-surefire-plugin}} > versions across all modules, some seem to be using version 2.19.1. -- This message was sent by Atlassian JIRA (v7.6.3#76005)
[jira] [Commented] (CAMEL-12608) Add default no-op implementation of RouteBuilder
[ https://issues.apache.org/jira/browse/CAMEL-12608?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16531062#comment-16531062 ] Zoran Regvart commented on CAMEL-12608: --- [~rhuss] yeah I don't think it's an issue now. It might be one in the future if we implement this -- then it locks us in into a lifecycle that says: you can use route Java DSL from object initialization code, not just in {{configure}} method. One use case where this might be an issue is with some external serialized form of the {{Routes}} subclass, the route Java DLS methods will get invoked during deserialization. If we put the contract at route Java DSL can be used at the point when {{configure}} method is invoked then we have lifecycle that we can manage, i.e. control the point when Java DSL will be invoked. Not that this is a bad approach, seems nice from a syntactical standpoint, this is only one side effect that I can think of... > Add default no-op implementation of RouteBuilder > > > Key: CAMEL-12608 > URL: https://issues.apache.org/jira/browse/CAMEL-12608 > Project: Camel > Issue Type: New Feature > Components: camel-core >Reporter: Roland Huss >Priority: Major > > Inspired by JMockit which use object initializers for introducing their Java > DSL, I think it would be a good idea to add a no-op default implementation of > RouteBuilder, with a short name like 'Routes'. > {code:java} > ctx.add(new Routes {{ > from("file:data/inbox?noop=true") > .to("file:data/outbox"); > }}); > {code} > That way one can avoid the creation of anonymous inner classes, which is not > only shorted and less boilerplate but also creates less classes and saves > non-heap memory. > > A simple POC as submitted as PR at > [https://github.com/apache/camel/pull/2401] which could be extended to > include better unit testing and documentation. -- This message was sent by Atlassian JIRA (v7.6.3#76005)
[jira] [Commented] (CAMEL-12596) Camel-Kafka security protocol SASL_PLAINTEXT not supported
[ https://issues.apache.org/jira/browse/CAMEL-12596?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16531045#comment-16531045 ] Andrea Cosentino commented on CAMEL-12596: -- You have some choice here http://camel.apache.org/commercial-camel-offerings.html > Camel-Kafka security protocol SASL_PLAINTEXT not supported > -- > > Key: CAMEL-12596 > URL: https://issues.apache.org/jira/browse/CAMEL-12596 > Project: Camel > Issue Type: Improvement > Components: camel-kafka >Affects Versions: 2.21.1 > Environment: * ActiveMQ v5.15.4 > * Camel:2.21.1 > * Kafka Clients: 1.1.0 > * Server Version: Apache/2.4.6(CentOS) >Reporter: Lizuca Mihaescu >Priority: Major > Attachments: camel.xml, camel.xml > > > I need to route ActiveMQ messages to Kafka(Cloudera) through Camel using > authentication protocol Kerberos. > > Kafka Security documentation states that it only supports *SASL_PLAINTEXT* > and *SASL_SSL* for Kerberos: > [https://www.cloudera.com/documentation/kafka/2-0-x/topics/kafka_security.html] > > | ** |*SSL*|*Kerberos*| > |PLAINTEXT|No|No| > |SSL|Yes|No| > |SASL_PLAINTEXT|No|Yes| > |SASL_SSL|Yes|Yes| > > > > On the other hand when I try to use *SASL_PLAINTEXT* for security protocol in > Camel I am getting an error during the ActiveMQ starting. As a result > ActiveMQ will not start. > > I took the latest Camel code from: [https://github.com/apache/camel.git] and > it states that it only supports *SSL* and *PLAINTEXT* as security protocols > values. > > | *securityProtocol* (security) | Protocol used to communicate with brokers. > Currently only PLAINTEXT and SSL are supported. | PLAINTEXT | String > > > I did find this solved issue: [https://access.redhat.com/solutions/3364871] > but I did not find any evidence that this is working in the latest Camel > version. > > My Camel setup fragment is: > {code:java} > uri="kafka://10.100.70.00:9092?topic=MyEvents.s1.v1&brokers=10.100.70.00:9092&requestTimeoutMs=305000&retries=3&keySerializerClass=org.apache.kafka.common.serialization.ByteArraySerializer&saslMechanism=GSSAPI&serializerClass=org.apache.kafka.common.serialization.ByteArraySerializer&securityProtocol=SASL_PLAINTEXT&saslKerberosServiceName=kafka"/>{code} > > I am using an external Jaas configuration file: > {code:java} > KafkaClient { > com.sun.security.auth.module.Krb5LoginModule required > useKeyTab=true > storeKey=true > keyTab="./user.keytab" > useTicketCache=false > serviceName="kafka" > principal=" Group/u...@domain.lan"; > };{code} > Why Camel does not support *SASL_PLAINTEXT* *and* *SASL_SSL*? > > Please help me this is *VERY IMPORTANT* for the project I am working on and > this issue is considered a blocker. I am also an experienced Java programmer > and I am willing to contribute if necessary to the open source code for such > implementation if the need may be. -- This message was sent by Atlassian JIRA (v7.6.3#76005)
[jira] [Comment Edited] (CAMEL-12596) Camel-Kafka security protocol SASL_PLAINTEXT not supported
[ https://issues.apache.org/jira/browse/CAMEL-12596?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16531045#comment-16531045 ] Andrea Cosentino edited comment on CAMEL-12596 at 7/3/18 8:54 AM: -- You have some choice here [http://camel.apache.org/commercial-camel-offerings.html] was (Author: ancosen): You have some choice here http://camel.apache.org/commercial-camel-offerings.html > Camel-Kafka security protocol SASL_PLAINTEXT not supported > -- > > Key: CAMEL-12596 > URL: https://issues.apache.org/jira/browse/CAMEL-12596 > Project: Camel > Issue Type: Improvement > Components: camel-kafka >Affects Versions: 2.21.1 > Environment: * ActiveMQ v5.15.4 > * Camel:2.21.1 > * Kafka Clients: 1.1.0 > * Server Version: Apache/2.4.6(CentOS) >Reporter: Lizuca Mihaescu >Priority: Major > Attachments: camel.xml, camel.xml > > > I need to route ActiveMQ messages to Kafka(Cloudera) through Camel using > authentication protocol Kerberos. > > Kafka Security documentation states that it only supports *SASL_PLAINTEXT* > and *SASL_SSL* for Kerberos: > [https://www.cloudera.com/documentation/kafka/2-0-x/topics/kafka_security.html] > > | ** |*SSL*|*Kerberos*| > |PLAINTEXT|No|No| > |SSL|Yes|No| > |SASL_PLAINTEXT|No|Yes| > |SASL_SSL|Yes|Yes| > > > > On the other hand when I try to use *SASL_PLAINTEXT* for security protocol in > Camel I am getting an error during the ActiveMQ starting. As a result > ActiveMQ will not start. > > I took the latest Camel code from: [https://github.com/apache/camel.git] and > it states that it only supports *SSL* and *PLAINTEXT* as security protocols > values. > > | *securityProtocol* (security) | Protocol used to communicate with brokers. > Currently only PLAINTEXT and SSL are supported. | PLAINTEXT | String > > > I did find this solved issue: [https://access.redhat.com/solutions/3364871] > but I did not find any evidence that this is working in the latest Camel > version. > > My Camel setup fragment is: > {code:java} > uri="kafka://10.100.70.00:9092?topic=MyEvents.s1.v1&brokers=10.100.70.00:9092&requestTimeoutMs=305000&retries=3&keySerializerClass=org.apache.kafka.common.serialization.ByteArraySerializer&saslMechanism=GSSAPI&serializerClass=org.apache.kafka.common.serialization.ByteArraySerializer&securityProtocol=SASL_PLAINTEXT&saslKerberosServiceName=kafka"/>{code} > > I am using an external Jaas configuration file: > {code:java} > KafkaClient { > com.sun.security.auth.module.Krb5LoginModule required > useKeyTab=true > storeKey=true > keyTab="./user.keytab" > useTicketCache=false > serviceName="kafka" > principal=" Group/u...@domain.lan"; > };{code} > Why Camel does not support *SASL_PLAINTEXT* *and* *SASL_SSL*? > > Please help me this is *VERY IMPORTANT* for the project I am working on and > this issue is considered a blocker. I am also an experienced Java programmer > and I am willing to contribute if necessary to the open source code for such > implementation if the need may be. -- This message was sent by Atlassian JIRA (v7.6.3#76005)
[jira] [Commented] (CAMEL-12596) Camel-Kafka security protocol SASL_PLAINTEXT not supported
[ https://issues.apache.org/jira/browse/CAMEL-12596?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16531041#comment-16531041 ] Dmitry Volodin commented on CAMEL-12596: [~macuzil] you are welcome to contact Red Hat office depends of the country of your location (or nearest country/region) https://www.redhat.com/en/about/office-locations > Camel-Kafka security protocol SASL_PLAINTEXT not supported > -- > > Key: CAMEL-12596 > URL: https://issues.apache.org/jira/browse/CAMEL-12596 > Project: Camel > Issue Type: Improvement > Components: camel-kafka >Affects Versions: 2.21.1 > Environment: * ActiveMQ v5.15.4 > * Camel:2.21.1 > * Kafka Clients: 1.1.0 > * Server Version: Apache/2.4.6(CentOS) >Reporter: Lizuca Mihaescu >Priority: Major > Attachments: camel.xml, camel.xml > > > I need to route ActiveMQ messages to Kafka(Cloudera) through Camel using > authentication protocol Kerberos. > > Kafka Security documentation states that it only supports *SASL_PLAINTEXT* > and *SASL_SSL* for Kerberos: > [https://www.cloudera.com/documentation/kafka/2-0-x/topics/kafka_security.html] > > | ** |*SSL*|*Kerberos*| > |PLAINTEXT|No|No| > |SSL|Yes|No| > |SASL_PLAINTEXT|No|Yes| > |SASL_SSL|Yes|Yes| > > > > On the other hand when I try to use *SASL_PLAINTEXT* for security protocol in > Camel I am getting an error during the ActiveMQ starting. As a result > ActiveMQ will not start. > > I took the latest Camel code from: [https://github.com/apache/camel.git] and > it states that it only supports *SSL* and *PLAINTEXT* as security protocols > values. > > | *securityProtocol* (security) | Protocol used to communicate with brokers. > Currently only PLAINTEXT and SSL are supported. | PLAINTEXT | String > > > I did find this solved issue: [https://access.redhat.com/solutions/3364871] > but I did not find any evidence that this is working in the latest Camel > version. > > My Camel setup fragment is: > {code:java} > uri="kafka://10.100.70.00:9092?topic=MyEvents.s1.v1&brokers=10.100.70.00:9092&requestTimeoutMs=305000&retries=3&keySerializerClass=org.apache.kafka.common.serialization.ByteArraySerializer&saslMechanism=GSSAPI&serializerClass=org.apache.kafka.common.serialization.ByteArraySerializer&securityProtocol=SASL_PLAINTEXT&saslKerberosServiceName=kafka"/>{code} > > I am using an external Jaas configuration file: > {code:java} > KafkaClient { > com.sun.security.auth.module.Krb5LoginModule required > useKeyTab=true > storeKey=true > keyTab="./user.keytab" > useTicketCache=false > serviceName="kafka" > principal=" Group/u...@domain.lan"; > };{code} > Why Camel does not support *SASL_PLAINTEXT* *and* *SASL_SSL*? > > Please help me this is *VERY IMPORTANT* for the project I am working on and > this issue is considered a blocker. I am also an experienced Java programmer > and I am willing to contribute if necessary to the open source code for such > implementation if the need may be. -- This message was sent by Atlassian JIRA (v7.6.3#76005)
[jira] [Commented] (CAMEL-12596) Camel-Kafka security protocol SASL_PLAINTEXT not supported
[ https://issues.apache.org/jira/browse/CAMEL-12596?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16531029#comment-16531029 ] Lizuca Mihaescu commented on CAMEL-12596: - [~ancosen] [~dmvolod] can you recommend a consultant who can help with this problem? > Camel-Kafka security protocol SASL_PLAINTEXT not supported > -- > > Key: CAMEL-12596 > URL: https://issues.apache.org/jira/browse/CAMEL-12596 > Project: Camel > Issue Type: Improvement > Components: camel-kafka >Affects Versions: 2.21.1 > Environment: * ActiveMQ v5.15.4 > * Camel:2.21.1 > * Kafka Clients: 1.1.0 > * Server Version: Apache/2.4.6(CentOS) >Reporter: Lizuca Mihaescu >Priority: Major > Attachments: camel.xml, camel.xml > > > I need to route ActiveMQ messages to Kafka(Cloudera) through Camel using > authentication protocol Kerberos. > > Kafka Security documentation states that it only supports *SASL_PLAINTEXT* > and *SASL_SSL* for Kerberos: > [https://www.cloudera.com/documentation/kafka/2-0-x/topics/kafka_security.html] > > | ** |*SSL*|*Kerberos*| > |PLAINTEXT|No|No| > |SSL|Yes|No| > |SASL_PLAINTEXT|No|Yes| > |SASL_SSL|Yes|Yes| > > > > On the other hand when I try to use *SASL_PLAINTEXT* for security protocol in > Camel I am getting an error during the ActiveMQ starting. As a result > ActiveMQ will not start. > > I took the latest Camel code from: [https://github.com/apache/camel.git] and > it states that it only supports *SSL* and *PLAINTEXT* as security protocols > values. > > | *securityProtocol* (security) | Protocol used to communicate with brokers. > Currently only PLAINTEXT and SSL are supported. | PLAINTEXT | String > > > I did find this solved issue: [https://access.redhat.com/solutions/3364871] > but I did not find any evidence that this is working in the latest Camel > version. > > My Camel setup fragment is: > {code:java} > uri="kafka://10.100.70.00:9092?topic=MyEvents.s1.v1&brokers=10.100.70.00:9092&requestTimeoutMs=305000&retries=3&keySerializerClass=org.apache.kafka.common.serialization.ByteArraySerializer&saslMechanism=GSSAPI&serializerClass=org.apache.kafka.common.serialization.ByteArraySerializer&securityProtocol=SASL_PLAINTEXT&saslKerberosServiceName=kafka"/>{code} > > I am using an external Jaas configuration file: > {code:java} > KafkaClient { > com.sun.security.auth.module.Krb5LoginModule required > useKeyTab=true > storeKey=true > keyTab="./user.keytab" > useTicketCache=false > serviceName="kafka" > principal=" Group/u...@domain.lan"; > };{code} > Why Camel does not support *SASL_PLAINTEXT* *and* *SASL_SSL*? > > Please help me this is *VERY IMPORTANT* for the project I am working on and > this issue is considered a blocker. I am also an experienced Java programmer > and I am willing to contribute if necessary to the open source code for such > implementation if the need may be. -- This message was sent by Atlassian JIRA (v7.6.3#76005)
[jira] [Commented] (CAMEL-12596) Camel-Kafka security protocol SASL_PLAINTEXT not supported
[ https://issues.apache.org/jira/browse/CAMEL-12596?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16531025#comment-16531025 ] Dmitry Volodin commented on CAMEL-12596: [~macuzil] at the first step of reproducing, you don't need to recreate whole env with AD, real users and sending messages. You just need to define why it's not bootstrapping with ActiveMQ and, next got Kerberos exception after sending a message. > Camel-Kafka security protocol SASL_PLAINTEXT not supported > -- > > Key: CAMEL-12596 > URL: https://issues.apache.org/jira/browse/CAMEL-12596 > Project: Camel > Issue Type: Improvement > Components: camel-kafka >Affects Versions: 2.21.1 > Environment: * ActiveMQ v5.15.4 > * Camel:2.21.1 > * Kafka Clients: 1.1.0 > * Server Version: Apache/2.4.6(CentOS) >Reporter: Lizuca Mihaescu >Priority: Major > Attachments: camel.xml, camel.xml > > > I need to route ActiveMQ messages to Kafka(Cloudera) through Camel using > authentication protocol Kerberos. > > Kafka Security documentation states that it only supports *SASL_PLAINTEXT* > and *SASL_SSL* for Kerberos: > [https://www.cloudera.com/documentation/kafka/2-0-x/topics/kafka_security.html] > > | ** |*SSL*|*Kerberos*| > |PLAINTEXT|No|No| > |SSL|Yes|No| > |SASL_PLAINTEXT|No|Yes| > |SASL_SSL|Yes|Yes| > > > > On the other hand when I try to use *SASL_PLAINTEXT* for security protocol in > Camel I am getting an error during the ActiveMQ starting. As a result > ActiveMQ will not start. > > I took the latest Camel code from: [https://github.com/apache/camel.git] and > it states that it only supports *SSL* and *PLAINTEXT* as security protocols > values. > > | *securityProtocol* (security) | Protocol used to communicate with brokers. > Currently only PLAINTEXT and SSL are supported. | PLAINTEXT | String > > > I did find this solved issue: [https://access.redhat.com/solutions/3364871] > but I did not find any evidence that this is working in the latest Camel > version. > > My Camel setup fragment is: > {code:java} > uri="kafka://10.100.70.00:9092?topic=MyEvents.s1.v1&brokers=10.100.70.00:9092&requestTimeoutMs=305000&retries=3&keySerializerClass=org.apache.kafka.common.serialization.ByteArraySerializer&saslMechanism=GSSAPI&serializerClass=org.apache.kafka.common.serialization.ByteArraySerializer&securityProtocol=SASL_PLAINTEXT&saslKerberosServiceName=kafka"/>{code} > > I am using an external Jaas configuration file: > {code:java} > KafkaClient { > com.sun.security.auth.module.Krb5LoginModule required > useKeyTab=true > storeKey=true > keyTab="./user.keytab" > useTicketCache=false > serviceName="kafka" > principal=" Group/u...@domain.lan"; > };{code} > Why Camel does not support *SASL_PLAINTEXT* *and* *SASL_SSL*? > > Please help me this is *VERY IMPORTANT* for the project I am working on and > this issue is considered a blocker. I am also an experienced Java programmer > and I am willing to contribute if necessary to the open source code for such > implementation if the need may be. -- This message was sent by Atlassian JIRA (v7.6.3#76005)
[jira] [Commented] (CAMEL-12596) Camel-Kafka security protocol SASL_PLAINTEXT not supported
[ https://issues.apache.org/jira/browse/CAMEL-12596?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16531008#comment-16531008 ] Andrea Cosentino commented on CAMEL-12596: -- I agree with [~dmvolod] > Camel-Kafka security protocol SASL_PLAINTEXT not supported > -- > > Key: CAMEL-12596 > URL: https://issues.apache.org/jira/browse/CAMEL-12596 > Project: Camel > Issue Type: Improvement > Components: camel-kafka >Affects Versions: 2.21.1 > Environment: * ActiveMQ v5.15.4 > * Camel:2.21.1 > * Kafka Clients: 1.1.0 > * Server Version: Apache/2.4.6(CentOS) >Reporter: Lizuca Mihaescu >Priority: Major > Attachments: camel.xml, camel.xml > > > I need to route ActiveMQ messages to Kafka(Cloudera) through Camel using > authentication protocol Kerberos. > > Kafka Security documentation states that it only supports *SASL_PLAINTEXT* > and *SASL_SSL* for Kerberos: > [https://www.cloudera.com/documentation/kafka/2-0-x/topics/kafka_security.html] > > | ** |*SSL*|*Kerberos*| > |PLAINTEXT|No|No| > |SSL|Yes|No| > |SASL_PLAINTEXT|No|Yes| > |SASL_SSL|Yes|Yes| > > > > On the other hand when I try to use *SASL_PLAINTEXT* for security protocol in > Camel I am getting an error during the ActiveMQ starting. As a result > ActiveMQ will not start. > > I took the latest Camel code from: [https://github.com/apache/camel.git] and > it states that it only supports *SSL* and *PLAINTEXT* as security protocols > values. > > | *securityProtocol* (security) | Protocol used to communicate with brokers. > Currently only PLAINTEXT and SSL are supported. | PLAINTEXT | String > > > I did find this solved issue: [https://access.redhat.com/solutions/3364871] > but I did not find any evidence that this is working in the latest Camel > version. > > My Camel setup fragment is: > {code:java} > uri="kafka://10.100.70.00:9092?topic=MyEvents.s1.v1&brokers=10.100.70.00:9092&requestTimeoutMs=305000&retries=3&keySerializerClass=org.apache.kafka.common.serialization.ByteArraySerializer&saslMechanism=GSSAPI&serializerClass=org.apache.kafka.common.serialization.ByteArraySerializer&securityProtocol=SASL_PLAINTEXT&saslKerberosServiceName=kafka"/>{code} > > I am using an external Jaas configuration file: > {code:java} > KafkaClient { > com.sun.security.auth.module.Krb5LoginModule required > useKeyTab=true > storeKey=true > keyTab="./user.keytab" > useTicketCache=false > serviceName="kafka" > principal=" Group/u...@domain.lan"; > };{code} > Why Camel does not support *SASL_PLAINTEXT* *and* *SASL_SSL*? > > Please help me this is *VERY IMPORTANT* for the project I am working on and > this issue is considered a blocker. I am also an experienced Java programmer > and I am willing to contribute if necessary to the open source code for such > implementation if the need may be. -- This message was sent by Atlassian JIRA (v7.6.3#76005)
[jira] [Commented] (CAMEL-12596) Camel-Kafka security protocol SASL_PLAINTEXT not supported
[ https://issues.apache.org/jira/browse/CAMEL-12596?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16531005#comment-16531005 ] Andrea Cosentino commented on CAMEL-12596: -- No, I don't. The environment is too complex, you need to create a minimized reproducer, so we can try it and see what happens. Also remember that Camel 2.21.1 is based on Kafka-clients 1.0.0 and not 1.1.0 > Camel-Kafka security protocol SASL_PLAINTEXT not supported > -- > > Key: CAMEL-12596 > URL: https://issues.apache.org/jira/browse/CAMEL-12596 > Project: Camel > Issue Type: Improvement > Components: camel-kafka >Affects Versions: 2.21.1 > Environment: * ActiveMQ v5.15.4 > * Camel:2.21.1 > * Kafka Clients: 1.1.0 > * Server Version: Apache/2.4.6(CentOS) >Reporter: Lizuca Mihaescu >Priority: Major > Attachments: camel.xml, camel.xml > > > I need to route ActiveMQ messages to Kafka(Cloudera) through Camel using > authentication protocol Kerberos. > > Kafka Security documentation states that it only supports *SASL_PLAINTEXT* > and *SASL_SSL* for Kerberos: > [https://www.cloudera.com/documentation/kafka/2-0-x/topics/kafka_security.html] > > | ** |*SSL*|*Kerberos*| > |PLAINTEXT|No|No| > |SSL|Yes|No| > |SASL_PLAINTEXT|No|Yes| > |SASL_SSL|Yes|Yes| > > > > On the other hand when I try to use *SASL_PLAINTEXT* for security protocol in > Camel I am getting an error during the ActiveMQ starting. As a result > ActiveMQ will not start. > > I took the latest Camel code from: [https://github.com/apache/camel.git] and > it states that it only supports *SSL* and *PLAINTEXT* as security protocols > values. > > | *securityProtocol* (security) | Protocol used to communicate with brokers. > Currently only PLAINTEXT and SSL are supported. | PLAINTEXT | String > > > I did find this solved issue: [https://access.redhat.com/solutions/3364871] > but I did not find any evidence that this is working in the latest Camel > version. > > My Camel setup fragment is: > {code:java} > uri="kafka://10.100.70.00:9092?topic=MyEvents.s1.v1&brokers=10.100.70.00:9092&requestTimeoutMs=305000&retries=3&keySerializerClass=org.apache.kafka.common.serialization.ByteArraySerializer&saslMechanism=GSSAPI&serializerClass=org.apache.kafka.common.serialization.ByteArraySerializer&securityProtocol=SASL_PLAINTEXT&saslKerberosServiceName=kafka"/>{code} > > I am using an external Jaas configuration file: > {code:java} > KafkaClient { > com.sun.security.auth.module.Krb5LoginModule required > useKeyTab=true > storeKey=true > keyTab="./user.keytab" > useTicketCache=false > serviceName="kafka" > principal=" Group/u...@domain.lan"; > };{code} > Why Camel does not support *SASL_PLAINTEXT* *and* *SASL_SSL*? > > Please help me this is *VERY IMPORTANT* for the project I am working on and > this issue is considered a blocker. I am also an experienced Java programmer > and I am willing to contribute if necessary to the open source code for such > implementation if the need may be. -- This message was sent by Atlassian JIRA (v7.6.3#76005)
[jira] [Closed] (CAMEL-11228) Create a new component for AWS Lamda
[ https://issues.apache.org/jira/browse/CAMEL-11228?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ] Luca Burgazzoli closed CAMEL-11228. --- Resolution: Duplicate > Create a new component for AWS Lamda > > > Key: CAMEL-11228 > URL: https://issues.apache.org/jira/browse/CAMEL-11228 > Project: Camel > Issue Type: New Feature >Reporter: Luca Burgazzoli >Priority: Minor > Fix For: Future > > > See > https://aws.amazon.com/blogs/developer/invoking-aws-lambda-functions-from-java/ -- This message was sent by Atlassian JIRA (v7.6.3#76005)
[jira] [Commented] (CAMEL-12596) Camel-Kafka security protocol SASL_PLAINTEXT not supported
[ https://issues.apache.org/jira/browse/CAMEL-12596?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16530996#comment-16530996 ] Lizuca Mihaescu commented on CAMEL-12596: - [~ancosen] The entire setup is complex and in a production environment :( therefore I cannot give you access. I can try to describe here the setup in hope you can might be able to give me some advice. Please do not close this issue. I will try to investigate on my own what is going on and try to create a smaller environment. Additional libraries: camel-core-2.21.1.jar camel-jms-2.21.1.jar camel-kafka-2.21.1.jar camel-spring-2.21.1.jar kafka-clients-1.1.0.jar Using Active Directory with user@DOMAIN Camel file: [^camel.xml] Verified KeyTab file for user@DOMAIN The main problem is that although the logging is set to DEBUG I cannot see any ERROR or WARN into the logs but just that the ActiveMQ shuts down after Kafka parameter setup. Some other peculiarity is that as soon as I only change SASL_PLAINTEXT to PLAINTEXT ActiveMQ starts up just fine. So, it would be fine if I can get some sort of ERROR or WARN to tell me it is something wrong with my Camel setup. I believe this you can see on your side, I mean the missed error handling. Do you have any integration testing for Camel Kafka Kerberos on your side? > Camel-Kafka security protocol SASL_PLAINTEXT not supported > -- > > Key: CAMEL-12596 > URL: https://issues.apache.org/jira/browse/CAMEL-12596 > Project: Camel > Issue Type: Improvement > Components: camel-kafka >Affects Versions: 2.21.1 > Environment: * ActiveMQ v5.15.4 > * Camel:2.21.1 > * Kafka Clients: 1.1.0 > * Server Version: Apache/2.4.6(CentOS) >Reporter: Lizuca Mihaescu >Priority: Major > Attachments: camel.xml, camel.xml > > > I need to route ActiveMQ messages to Kafka(Cloudera) through Camel using > authentication protocol Kerberos. > > Kafka Security documentation states that it only supports *SASL_PLAINTEXT* > and *SASL_SSL* for Kerberos: > [https://www.cloudera.com/documentation/kafka/2-0-x/topics/kafka_security.html] > > | ** |*SSL*|*Kerberos*| > |PLAINTEXT|No|No| > |SSL|Yes|No| > |SASL_PLAINTEXT|No|Yes| > |SASL_SSL|Yes|Yes| > > > > On the other hand when I try to use *SASL_PLAINTEXT* for security protocol in > Camel I am getting an error during the ActiveMQ starting. As a result > ActiveMQ will not start. > > I took the latest Camel code from: [https://github.com/apache/camel.git] and > it states that it only supports *SSL* and *PLAINTEXT* as security protocols > values. > > | *securityProtocol* (security) | Protocol used to communicate with brokers. > Currently only PLAINTEXT and SSL are supported. | PLAINTEXT | String > > > I did find this solved issue: [https://access.redhat.com/solutions/3364871] > but I did not find any evidence that this is working in the latest Camel > version. > > My Camel setup fragment is: > {code:java} > uri="kafka://10.100.70.00:9092?topic=MyEvents.s1.v1&brokers=10.100.70.00:9092&requestTimeoutMs=305000&retries=3&keySerializerClass=org.apache.kafka.common.serialization.ByteArraySerializer&saslMechanism=GSSAPI&serializerClass=org.apache.kafka.common.serialization.ByteArraySerializer&securityProtocol=SASL_PLAINTEXT&saslKerberosServiceName=kafka"/>{code} > > I am using an external Jaas configuration file: > {code:java} > KafkaClient { > com.sun.security.auth.module.Krb5LoginModule required > useKeyTab=true > storeKey=true > keyTab="./user.keytab" > useTicketCache=false > serviceName="kafka" > principal=" Group/u...@domain.lan"; > };{code} > Why Camel does not support *SASL_PLAINTEXT* *and* *SASL_SSL*? > > Please help me this is *VERY IMPORTANT* for the project I am working on and > this issue is considered a blocker. I am also an experienced Java programmer > and I am willing to contribute if necessary to the open source code for such > implementation if the need may be. -- This message was sent by Atlassian JIRA (v7.6.3#76005)
[jira] [Closed] (CAMEL-11200) reactive-streams : create a vertx based implementation of ReactorStreamsService
[ https://issues.apache.org/jira/browse/CAMEL-11200?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ] Luca Burgazzoli closed CAMEL-11200. --- Resolution: Won't Fix > reactive-streams : create a vertx based implementation of > ReactorStreamsService > --- > > Key: CAMEL-11200 > URL: https://issues.apache.org/jira/browse/CAMEL-11200 > Project: Camel > Issue Type: New Feature >Reporter: Luca Burgazzoli >Priority: Major > Fix For: 3.0.0, Future > > > http://vertx.io/docs/vertx-reactive-streams/java/ -- This message was sent by Atlassian JIRA (v7.6.3#76005)
[jira] [Issue Comment Deleted] (CAMEL-11451) Create camel component for Atomix v3
[ https://issues.apache.org/jira/browse/CAMEL-11451?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ] Luca Burgazzoli updated CAMEL-11451: Comment: was deleted (was: Atomix devs have release 2.1.0 beta3 recently and they are working to document it, once done we can start implementing it) > Create camel component for Atomix v3 > > > Key: CAMEL-11451 > URL: https://issues.apache.org/jira/browse/CAMEL-11451 > Project: Camel > Issue Type: New Feature >Reporter: Luca Burgazzoli >Priority: Minor > Fix For: Future > > > Atomix will get a major refactoring in v3.0so it may be nice to have a > separate component instead of upgrading the existing one. -- This message was sent by Atlassian JIRA (v7.6.3#76005)
[jira] [Updated] (CAMEL-11451) Create camel component for Atomix v3
[ https://issues.apache.org/jira/browse/CAMEL-11451?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ] Luca Burgazzoli updated CAMEL-11451: Description: Atomix will get a major refactoring in v3.0so it may be nice to have a separate component instead of upgrading the existing one. (was: Atomix will get a major refactoring in v2.0 (no ETA yet, should be released before EOY) so it may be nice to have a separate component instead of upgrading the existing one. See https://github.com/atomix/atomix/tree/2.0.0) > Create camel component for Atomix v3 > > > Key: CAMEL-11451 > URL: https://issues.apache.org/jira/browse/CAMEL-11451 > Project: Camel > Issue Type: New Feature >Reporter: Luca Burgazzoli >Priority: Minor > Fix For: Future > > > Atomix will get a major refactoring in v3.0so it may be nice to have a > separate component instead of upgrading the existing one. -- This message was sent by Atlassian JIRA (v7.6.3#76005)
[jira] [Updated] (CAMEL-11451) Create camel component for Atomix v3
[ https://issues.apache.org/jira/browse/CAMEL-11451?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ] Luca Burgazzoli updated CAMEL-11451: Summary: Create camel component for Atomix v3 (was: Create camel component for Atomix v2) > Create camel component for Atomix v3 > > > Key: CAMEL-11451 > URL: https://issues.apache.org/jira/browse/CAMEL-11451 > Project: Camel > Issue Type: New Feature >Reporter: Luca Burgazzoli >Priority: Minor > Fix For: Future > > > Atomix will get a major refactoring in v2.0 (no ETA yet, should be released > before EOY) so it may be nice to have a separate component instead of > upgrading the existing one. > See https://github.com/atomix/atomix/tree/2.0.0 -- This message was sent by Atlassian JIRA (v7.6.3#76005)
[jira] [Resolved] (CAMEL-11865) spring-boot 2.x : use ApplicationContextRunner to check auto-configuration correctness
[ https://issues.apache.org/jira/browse/CAMEL-11865?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ] Luca Burgazzoli resolved CAMEL-11865. - Resolution: Fixed > spring-boot 2.x : use ApplicationContextRunner to check auto-configuration > correctness > -- > > Key: CAMEL-11865 > URL: https://issues.apache.org/jira/browse/CAMEL-11865 > Project: Camel > Issue Type: Improvement > Components: camel-spring-boot, camel-spring-boot-starters >Reporter: Luca Burgazzoli >Priority: Major > Fix For: 3.0.0, Future > > > Once moved to spring-boot 2.x, use ApplicationContextRunner to check > auto-configuration correctness, see: > https://github.com/spring-projects/spring-boot/blob/master/spring-boot-test/src/main/java/org/springframework/boot/test/context/runner/ApplicationContextRunner.java > https://github.com/spring-projects/spring-boot/blob/master/spring-boot-test/src/main/java/org/springframework/boot/test/context/runner/AbstractApplicationContextRunner.java -- This message was sent by Atlassian JIRA (v7.6.3#76005)
[jira] [Commented] (CAMEL-12596) Camel-Kafka security protocol SASL_PLAINTEXT not supported
[ https://issues.apache.org/jira/browse/CAMEL-12596?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16530973#comment-16530973 ] Dmitry Volodin commented on CAMEL-12596: [~macuzil] could you create a much more simple reproducer based on the latest camel release, embedded ActiveMQ broker and plain Kafka (without Cloudera setup) and publish it to github to investigate this problem? As Andrea said above, it's very dangerous to start high important project without product enterprise (with guarantied SLA) support. > Camel-Kafka security protocol SASL_PLAINTEXT not supported > -- > > Key: CAMEL-12596 > URL: https://issues.apache.org/jira/browse/CAMEL-12596 > Project: Camel > Issue Type: Improvement > Components: camel-kafka >Affects Versions: 2.21.1 > Environment: * ActiveMQ v5.15.4 > * Camel:2.21.1 > * Kafka Clients: 1.1.0 > * Server Version: Apache/2.4.6(CentOS) >Reporter: Lizuca Mihaescu >Priority: Major > Attachments: camel.xml, camel.xml > > > I need to route ActiveMQ messages to Kafka(Cloudera) through Camel using > authentication protocol Kerberos. > > Kafka Security documentation states that it only supports *SASL_PLAINTEXT* > and *SASL_SSL* for Kerberos: > [https://www.cloudera.com/documentation/kafka/2-0-x/topics/kafka_security.html] > > | ** |*SSL*|*Kerberos*| > |PLAINTEXT|No|No| > |SSL|Yes|No| > |SASL_PLAINTEXT|No|Yes| > |SASL_SSL|Yes|Yes| > > > > On the other hand when I try to use *SASL_PLAINTEXT* for security protocol in > Camel I am getting an error during the ActiveMQ starting. As a result > ActiveMQ will not start. > > I took the latest Camel code from: [https://github.com/apache/camel.git] and > it states that it only supports *SSL* and *PLAINTEXT* as security protocols > values. > > | *securityProtocol* (security) | Protocol used to communicate with brokers. > Currently only PLAINTEXT and SSL are supported. | PLAINTEXT | String > > > I did find this solved issue: [https://access.redhat.com/solutions/3364871] > but I did not find any evidence that this is working in the latest Camel > version. > > My Camel setup fragment is: > {code:java} > uri="kafka://10.100.70.00:9092?topic=MyEvents.s1.v1&brokers=10.100.70.00:9092&requestTimeoutMs=305000&retries=3&keySerializerClass=org.apache.kafka.common.serialization.ByteArraySerializer&saslMechanism=GSSAPI&serializerClass=org.apache.kafka.common.serialization.ByteArraySerializer&securityProtocol=SASL_PLAINTEXT&saslKerberosServiceName=kafka"/>{code} > > I am using an external Jaas configuration file: > {code:java} > KafkaClient { > com.sun.security.auth.module.Krb5LoginModule required > useKeyTab=true > storeKey=true > keyTab="./user.keytab" > useTicketCache=false > serviceName="kafka" > principal=" Group/u...@domain.lan"; > };{code} > Why Camel does not support *SASL_PLAINTEXT* *and* *SASL_SSL*? > > Please help me this is *VERY IMPORTANT* for the project I am working on and > this issue is considered a blocker. I am also an experienced Java programmer > and I am willing to contribute if necessary to the open source code for such > implementation if the need may be. -- This message was sent by Atlassian JIRA (v7.6.3#76005)
[jira] [Updated] (CAMEL-12596) Camel-Kafka security protocol SASL_PLAINTEXT not supported
[ https://issues.apache.org/jira/browse/CAMEL-12596?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ] Lizuca Mihaescu updated CAMEL-12596: Attachment: camel.xml > Camel-Kafka security protocol SASL_PLAINTEXT not supported > -- > > Key: CAMEL-12596 > URL: https://issues.apache.org/jira/browse/CAMEL-12596 > Project: Camel > Issue Type: Improvement > Components: camel-kafka >Affects Versions: 2.21.1 > Environment: * ActiveMQ v5.15.4 > * Camel:2.21.1 > * Kafka Clients: 1.1.0 > * Server Version: Apache/2.4.6(CentOS) >Reporter: Lizuca Mihaescu >Priority: Major > Attachments: camel.xml, camel.xml > > > I need to route ActiveMQ messages to Kafka(Cloudera) through Camel using > authentication protocol Kerberos. > > Kafka Security documentation states that it only supports *SASL_PLAINTEXT* > and *SASL_SSL* for Kerberos: > [https://www.cloudera.com/documentation/kafka/2-0-x/topics/kafka_security.html] > > | ** |*SSL*|*Kerberos*| > |PLAINTEXT|No|No| > |SSL|Yes|No| > |SASL_PLAINTEXT|No|Yes| > |SASL_SSL|Yes|Yes| > > > > On the other hand when I try to use *SASL_PLAINTEXT* for security protocol in > Camel I am getting an error during the ActiveMQ starting. As a result > ActiveMQ will not start. > > I took the latest Camel code from: [https://github.com/apache/camel.git] and > it states that it only supports *SSL* and *PLAINTEXT* as security protocols > values. > > | *securityProtocol* (security) | Protocol used to communicate with brokers. > Currently only PLAINTEXT and SSL are supported. | PLAINTEXT | String > > > I did find this solved issue: [https://access.redhat.com/solutions/3364871] > but I did not find any evidence that this is working in the latest Camel > version. > > My Camel setup fragment is: > {code:java} > uri="kafka://10.100.70.00:9092?topic=MyEvents.s1.v1&brokers=10.100.70.00:9092&requestTimeoutMs=305000&retries=3&keySerializerClass=org.apache.kafka.common.serialization.ByteArraySerializer&saslMechanism=GSSAPI&serializerClass=org.apache.kafka.common.serialization.ByteArraySerializer&securityProtocol=SASL_PLAINTEXT&saslKerberosServiceName=kafka"/>{code} > > I am using an external Jaas configuration file: > {code:java} > KafkaClient { > com.sun.security.auth.module.Krb5LoginModule required > useKeyTab=true > storeKey=true > keyTab="./user.keytab" > useTicketCache=false > serviceName="kafka" > principal=" Group/u...@domain.lan"; > };{code} > Why Camel does not support *SASL_PLAINTEXT* *and* *SASL_SSL*? > > Please help me this is *VERY IMPORTANT* for the project I am working on and > this issue is considered a blocker. I am also an experienced Java programmer > and I am willing to contribute if necessary to the open source code for such > implementation if the need may be. -- This message was sent by Atlassian JIRA (v7.6.3#76005)
[jira] [Updated] (CAMEL-12596) Camel-Kafka security protocol SASL_PLAINTEXT not supported
[ https://issues.apache.org/jira/browse/CAMEL-12596?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ] Lizuca Mihaescu updated CAMEL-12596: Attachment: camel.xml > Camel-Kafka security protocol SASL_PLAINTEXT not supported > -- > > Key: CAMEL-12596 > URL: https://issues.apache.org/jira/browse/CAMEL-12596 > Project: Camel > Issue Type: Improvement > Components: camel-kafka >Affects Versions: 2.21.1 > Environment: * ActiveMQ v5.15.4 > * Camel:2.21.1 > * Kafka Clients: 1.1.0 > * Server Version: Apache/2.4.6(CentOS) >Reporter: Lizuca Mihaescu >Priority: Major > Attachments: camel.xml > > > I need to route ActiveMQ messages to Kafka(Cloudera) through Camel using > authentication protocol Kerberos. > > Kafka Security documentation states that it only supports *SASL_PLAINTEXT* > and *SASL_SSL* for Kerberos: > [https://www.cloudera.com/documentation/kafka/2-0-x/topics/kafka_security.html] > > | ** |*SSL*|*Kerberos*| > |PLAINTEXT|No|No| > |SSL|Yes|No| > |SASL_PLAINTEXT|No|Yes| > |SASL_SSL|Yes|Yes| > > > > On the other hand when I try to use *SASL_PLAINTEXT* for security protocol in > Camel I am getting an error during the ActiveMQ starting. As a result > ActiveMQ will not start. > > I took the latest Camel code from: [https://github.com/apache/camel.git] and > it states that it only supports *SSL* and *PLAINTEXT* as security protocols > values. > > | *securityProtocol* (security) | Protocol used to communicate with brokers. > Currently only PLAINTEXT and SSL are supported. | PLAINTEXT | String > > > I did find this solved issue: [https://access.redhat.com/solutions/3364871] > but I did not find any evidence that this is working in the latest Camel > version. > > My Camel setup fragment is: > {code:java} > uri="kafka://10.100.70.00:9092?topic=MyEvents.s1.v1&brokers=10.100.70.00:9092&requestTimeoutMs=305000&retries=3&keySerializerClass=org.apache.kafka.common.serialization.ByteArraySerializer&saslMechanism=GSSAPI&serializerClass=org.apache.kafka.common.serialization.ByteArraySerializer&securityProtocol=SASL_PLAINTEXT&saslKerberosServiceName=kafka"/>{code} > > I am using an external Jaas configuration file: > {code:java} > KafkaClient { > com.sun.security.auth.module.Krb5LoginModule required > useKeyTab=true > storeKey=true > keyTab="./user.keytab" > useTicketCache=false > serviceName="kafka" > principal=" Group/u...@domain.lan"; > };{code} > Why Camel does not support *SASL_PLAINTEXT* *and* *SASL_SSL*? > > Please help me this is *VERY IMPORTANT* for the project I am working on and > this issue is considered a blocker. I am also an experienced Java programmer > and I am willing to contribute if necessary to the open source code for such > implementation if the need may be. -- This message was sent by Atlassian JIRA (v7.6.3#76005)
[jira] [Commented] (CAMEL-12597) camel-servlet - Add whitelist for accepted file types
[ https://issues.apache.org/jira/browse/CAMEL-12597?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16530940#comment-16530940 ] Claus Ibsen commented on CAMEL-12597: - Yeah it can be that too. It should be a component level option. We can then allow to configure this on endpoint level as well. So endpoint overrides component level. > camel-servlet - Add whitelist for accepted file types > - > > Key: CAMEL-12597 > URL: https://issues.apache.org/jira/browse/CAMEL-12597 > Project: Camel > Issue Type: Improvement > Components: camel-servlet >Reporter: Claus Ibsen >Priority: Major > Fix For: 2.23.0 > > > Reported on user forum > http://camel.465427.n5.nabble.com/Report-Issues-Apache-Camel-Servlet-Component-td5820710.html -- This message was sent by Atlassian JIRA (v7.6.3#76005)