[jira] [Commented] (CAMEL-17721) MDC - custom MDC property value is fixed to first assigned value by MDCUnitOfWork

2023-12-21 Thread Nathan (Jira)


[ 
https://issues.apache.org/jira/browse/CAMEL-17721?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17799449#comment-17799449
 ] 

Nathan commented on CAMEL-17721:


I have the same issue, but I'm not convinced the current solution will actually 
fix this completely. This is the implemented solution for this issue right now:
{code:java}
// keep existing custom value to not override
custom.forEach((k, v) -> {
  if (MDC.get(k) == null) {
MDC.put(k, v);
  }
});
{code}

But this will not allow MDC.remove actions, since any removed key will still be 
put back. And potentially more dangerous this is the restore process for 
asynchronous threads, so if an asynchronous thread has changed the MDC it will 
be kept.

I think this is because the doneSync of the MDCCallback is practically always 
false, so it does this cleanup even for synchronous processing. This seems to 
be because the CamelInternalProcessor is always wrapped into an 
AsyncProcessorSupport, which calls everything in an asynchronous way. Meaning 
the callback clear is always done and the MDC is always reset, even though it 
should only be reset after an asynchronous event.






> MDC - custom MDC property value is fixed to first assigned value by 
> MDCUnitOfWork
> -
>
> Key: CAMEL-17721
> URL: https://issues.apache.org/jira/browse/CAMEL-17721
> Project: Camel
>  Issue Type: Bug
>  Components: came-core
>Affects Versions: 3.11.5, 3.14.1
>Reporter: Vladimir Dobos
>Assignee: Claus Ibsen
>Priority: Minor
> Fix For: 4.4.0
>
>
> Once value (that matches "mdc-logging-keys-pattern" from configuration) is 
> assigned/set to MDC and gets into MDCUnitOfWorks#MDCCallback "custom" map, it 
> cannot be changed further down in the route (at least in processor), as 
> changed value is always overwritten at the end of processing step with 
> originally assigned value.
> This breaks use-cases, when you want to assign temporary value to one MDC 
> property to signify the value could not be retrieved during some processing 
> steps (but can be assigned further down).
> For example, when you assign, for example N/A to property "someID" in 
> processor, right after consumer at the start of route, and want to change it 
> few steps down, it will be overwritten back to "N/A" by MDCCallback.
> This interacts nastily with CAMEL-17722, making custom MDC properties 
> unusable.
>  
> Tested in single-threaded route with no async processing.



--
This message was sent by Atlassian Jira
(v8.20.10#820010)


[jira] [Commented] (CAMEL-18367) Unable to use MDC variables in transacted route

2023-12-20 Thread Nathan (Jira)


[ 
https://issues.apache.org/jira/browse/CAMEL-18367?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17798936#comment-17798936
 ] 

Nathan commented on CAMEL-18367:


I think this is normal actually, if I understand the internal logic correctly 
the MDCUnitOfWork is meant to safeguard the MDC against changes from 
asynchronous threads. Since the internal processor always does things 
synchronously if there is a transaction, there is no reason to call the 
MDCUnitOfWork.

> Unable to use MDC variables in transacted route
> ---
>
> Key: CAMEL-18367
> URL: https://issues.apache.org/jira/browse/CAMEL-18367
> Project: Camel
>  Issue Type: Bug
>  Components: camel-core
>Affects Versions: 3.14.4
>Reporter: Rastislav Papp
>Priority: Minor
>
> I have a route which is {{{}.transacted(){}}}. I use {{{}MDCUnitOfWork{}}}, 
> whose {{beforeProcess}} and {{afterProcess}} methods are called in 
> {{CamelInternalProcessor}} - {*}but only if the route is not transacted{*}. 
> With my limited camel internals knowledge, I do not understand why 
> {{beforeProcess}} and {{afterProcess}} are called only for non-transacted 
> routes. In my typical scenario, MDC variables work well until I get to a 
> transacted route, then at the last processor before the transacted route the 
> {{afterProcess}} (which clears MDC variables) is called, and 
> {{beforeProcess}} is never called, so there are no MDC variables inside the 
> transacted route.



--
This message was sent by Atlassian Jira
(v8.20.10#820010)


[jira] [Commented] (CAMEL-14739) RouteContext missing for RedeliveryErrorHandler

2020-03-19 Thread Nathan (Jira)


[ 
https://issues.apache.org/jira/browse/CAMEL-14739?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17062718#comment-17062718
 ] 

Nathan commented on CAMEL-14739:


I've added an example with 3 rest operations to show the different cases, it 
took some extra time since the condition for which the bug happens is 
apparently not after a route call, but only after a route call that directs to 
another route call.

> RouteContext missing for RedeliveryErrorHandler
> ---
>
> Key: CAMEL-14739
> URL: https://issues.apache.org/jira/browse/CAMEL-14739
> Project: Camel
>  Issue Type: Bug
>  Components: came-core
>Affects Versions: 3.1.0
>Reporter: Nathan
>Assignee: Guillaume Nodet
>Priority: Major
> Fix For: 3.2.0
>
> Attachments: camel-error-test.zip
>
>
> The RedeliveryErrorHandler needs the RouteContext to determine which 
> onException rule to use.
> The RouteContext is set at the start of a route, when leaving a route the 
> RouteContext should be set to the route that called it. However it is 
> apparently null, which means that if an error happens at that point it cannot 
> use the onException rules that have been set.
> In 3.0 the RouteContext was a stack so it kept track of all the routes that 
> it passed, meaning automatically returned to the parent RouteContext value.



--
This message was sent by Atlassian Jira
(v8.3.4#803005)


[jira] [Updated] (CAMEL-14739) RouteContext missing for RedeliveryErrorHandler

2020-03-19 Thread Nathan (Jira)


 [ 
https://issues.apache.org/jira/browse/CAMEL-14739?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
 ]

Nathan updated CAMEL-14739:
---
Attachment: camel-error-test.zip

> RouteContext missing for RedeliveryErrorHandler
> ---
>
> Key: CAMEL-14739
> URL: https://issues.apache.org/jira/browse/CAMEL-14739
> Project: Camel
>  Issue Type: Bug
>  Components: came-core
>Affects Versions: 3.1.0
>Reporter: Nathan
>Assignee: Guillaume Nodet
>Priority: Major
> Fix For: 3.2.0
>
> Attachments: camel-error-test.zip
>
>
> The RedeliveryErrorHandler needs the RouteContext to determine which 
> onException rule to use.
> The RouteContext is set at the start of a route, when leaving a route the 
> RouteContext should be set to the route that called it. However it is 
> apparently null, which means that if an error happens at that point it cannot 
> use the onException rules that have been set.
> In 3.0 the RouteContext was a stack so it kept track of all the routes that 
> it passed, meaning automatically returned to the parent RouteContext value.



--
This message was sent by Atlassian Jira
(v8.3.4#803005)


[jira] [Created] (CAMEL-14739) RouteContext missing for RedeliveryErrorHandler

2020-03-19 Thread Nathan (Jira)
Nathan created CAMEL-14739:
--

 Summary: RouteContext missing for RedeliveryErrorHandler
 Key: CAMEL-14739
 URL: https://issues.apache.org/jira/browse/CAMEL-14739
 Project: Camel
  Issue Type: Bug
  Components: came-core
Affects Versions: 3.1.0
Reporter: Nathan


The RedeliveryErrorHandler needs the RouteContext to determine which 
onException rule to use.

The RouteContext is set at the start of a route, when leaving a route the 
RouteContext should be set to the route that called it. However it is 
apparently null, which means that if an error happens at that point it cannot 
use the onException rules that have been set.

In 3.0 the RouteContext was a stack so it kept track of all the routes that it 
passed, meaning automatically returned to the parent RouteContext value.



--
This message was sent by Atlassian Jira
(v8.3.4#803005)


[jira] [Created] (CAMEL-7836) ConcurrentModificationException when creating dynamic routes

2014-09-18 Thread Matt Nathan (JIRA)
Matt Nathan created CAMEL-7836:
--

 Summary: ConcurrentModificationException when creating dynamic 
routes
 Key: CAMEL-7836
 URL: https://issues.apache.org/jira/browse/CAMEL-7836
 Project: Camel
  Issue Type: Bug
  Components: camel-core
Affects Versions: 2.13.1
Reporter: Matt Nathan


There is a (small) chance of ConcurrentModificationException when creating 
routes dynamically.

{noformat}
java.util.ConcurrentModificationException
  at 
java.util.LinkedHashMap$LinkedHashIterator.nextEntry(LinkedHashMap.java:373)
  at java.util.LinkedHashMap$KeyIterator.next(LinkedHashMap.java:384)
  at java.util.AbstractCollection.toArray(AbstractCollection.java:124)
  at java.util.ArrayList.(ArrayList.java:131)
  at 
org.apache.camel.impl.DefaultCamelContext.getRoutes(DefaultCamelContext.java:650)
  at 
org.apache.camel.impl.DefaultCamelContext.getRoute(DefaultCamelContext.java:655)
{noformat}

The cause is that if you happen to be calling {{getRoute}} at the same time you 
are creating a new route then the internals of {{new ArrayList}} call 
{{collection.toArray}} which throws the error.



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)


[jira] [Created] (CAMEL-7254) MailComponent 'peek' doesn't work due to programming error

2014-02-27 Thread Matt Nathan (JIRA)
Matt Nathan created CAMEL-7254:
--

 Summary: MailComponent 'peek' doesn't work due to programming error
 Key: CAMEL-7254
 URL: https://issues.apache.org/jira/browse/CAMEL-7254
 Project: Camel
  Issue Type: Bug
  Components: camel-mail
Affects Versions: 2.12.2
Reporter: Matt Nathan
Priority: Critical


The MailComponent peek setting doesn't work due to the following line:

{code:java}
private void peekMessage(Message mail) {
// this only applies to IMAP messages which has a setPeek method
if (mail.getClass().getName().startsWith("IMAP")) {
try {
LOG.trace("Calling setPeek(true) on mail message {}", mail);
IntrospectionSupport.setProperty(mail, "peek", true);
} catch (Throwable e) {
// ignore
LOG.trace("Error setting peak property to true on: " + mail + 
". This exception is ignored.", e);
}
}
}
{code}

The line that checks the class name for IMAP should be using getSimpleName. 
Otherwise it's checking the package name instead.

This effectively means that rollback of processing in camel mail is not 
supported.



--
This message was sent by Atlassian JIRA
(v6.1.5#6160)


[jira] [Commented] (CAMEL-7247) No way to 'abort' the onCompletion action of the MailConsumer

2014-02-27 Thread Matt Nathan (JIRA)

[ 
https://issues.apache.org/jira/browse/CAMEL-7247?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13914557#comment-13914557
 ] 

Matt Nathan commented on CAMEL-7247:


Just had a thought that it would also be ok if you added an 
inProgressRepository property to the mail consumer, like you have in the 
GenericFileConsumer style classes.

> No way to 'abort' the onCompletion action of the MailConsumer
> -
>
> Key: CAMEL-7247
> URL: https://issues.apache.org/jira/browse/CAMEL-7247
> Project: Camel
>  Issue Type: Improvement
>  Components: camel-mail
>Affects Versions: 2.12.2
>Reporter: Matt Nathan
>
> I have a route that reads from an email inbox, passes the message through a 
> distributed IdempotentConsumer and then processes the mail if it's not been 
> seen before.
> The reason I have this setup is because we are running multiple instances of 
> camel all pointing to the same inbox and don't want mails to be processed 
> more than once across the cluster.
> Now leaving aside the fact that this may not be the best way to achieve what 
> we want to do, the issue I have is that when the route completes, either by 
> 'aborting' as part of the IdempotentConsumer filtering or by processing the 
> mail successfully, the completion listener added by the MailComponent always 
> gets called.
> This is not ideal because it effectively disables any rollback or 
> reprocessing logic that may exist, and was even more problematic for us as we 
> had delete=true set on the MailConsumer, which meant mails were removed under 
> the feet of the node that was actually processing the mail.
> What I'd like is a way for the route to complete successfully but for the 
> MailComponent to not do anything to the mail. A state which is currently 
> impossible without overriding the mail component (it either marks as deleted 
> or marks as read, there is no 'don't do anything' option)



--
This message was sent by Atlassian JIRA
(v6.1.5#6160)


[jira] [Updated] (CAMEL-7247) No way to 'abort' the onCompletion action of the MailConsumer

2014-02-27 Thread Matt Nathan (JIRA)

 [ 
https://issues.apache.org/jira/browse/CAMEL-7247?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
 ]

Matt Nathan updated CAMEL-7247:
---

Description: 
I have a route that reads from an email inbox, passes the message through a 
distributed IdempotentConsumer and then processes the mail if it's not been 
seen before.

The reason I have this setup is because we are running multiple instances of 
camel all pointing to the same inbox and don't want mails to be processed more 
than once across the cluster.

Now leaving aside the fact that this may not be the best way to achieve what we 
want to do, the issue I have is that when the route completes, either by 
'aborting' as part of the IdempotentConsumer filtering or by processing the 
mail successfully, the completion listener added by the MailComponent always 
gets called.

This is not ideal because it effectively disables any rollback or reprocessing 
logic that may exist, and was even more problematic for us as we had 
delete=true set on the MailConsumer, which meant mails were removed under the 
feet of the node that was actually processing the mail.

What I'd like is a way for the route to complete successfully but for the 
MailComponent to not do anything to the mail. A state which is currently 
impossible without overriding the mail component (it either marks as deleted or 
marks as read, there is no 'don't do anything' option)

  was:
I have a route that reads from an email inbox, passes the message through a 
distributed IdempotentConsumer and then processes the mail if it's not been 
seen before.

The reason I have this setup is because we are running multiple instances of 
camel all pointing to the same inbox and don't mails to be processed more than 
once across the cluster.

Now leaving aside the fact that this may not be the best way to achieve what we 
want to do, the issue I have is that when the route completes, either by 
'aborting' as part of the IdempotentConsumer filtering or by processing the 
mail successfully, the completion listener added by the MailComponent always 
gets called.

This is not ideal because it effectively disables any rollback or reprocessing 
logic that may exist, and was even more problematic for us as we had 
delete=true set on the MailConsumer, which meant mails were removed under the 
feet of the node that was actually processing the mail.

What I'd like is a way for the route to complete successfully but for the 
MailComponent to not do anything to the mail. A state which is currently 
impossible without overriding the mail component (it either marks as deleted or 
marks as read, there is no 'don't do anything' option)


> No way to 'abort' the onCompletion action of the MailConsumer
> -
>
> Key: CAMEL-7247
> URL: https://issues.apache.org/jira/browse/CAMEL-7247
> Project: Camel
>  Issue Type: Improvement
>  Components: camel-mail
>Affects Versions: 2.12.2
>Reporter: Matt Nathan
>
> I have a route that reads from an email inbox, passes the message through a 
> distributed IdempotentConsumer and then processes the mail if it's not been 
> seen before.
> The reason I have this setup is because we are running multiple instances of 
> camel all pointing to the same inbox and don't want mails to be processed 
> more than once across the cluster.
> Now leaving aside the fact that this may not be the best way to achieve what 
> we want to do, the issue I have is that when the route completes, either by 
> 'aborting' as part of the IdempotentConsumer filtering or by processing the 
> mail successfully, the completion listener added by the MailComponent always 
> gets called.
> This is not ideal because it effectively disables any rollback or 
> reprocessing logic that may exist, and was even more problematic for us as we 
> had delete=true set on the MailConsumer, which meant mails were removed under 
> the feet of the node that was actually processing the mail.
> What I'd like is a way for the route to complete successfully but for the 
> MailComponent to not do anything to the mail. A state which is currently 
> impossible without overriding the mail component (it either marks as deleted 
> or marks as read, there is no 'don't do anything' option)



--
This message was sent by Atlassian JIRA
(v6.1.5#6160)


[jira] [Created] (CAMEL-7247) No way to 'abort' the onCompletion action of the MailConsumer

2014-02-27 Thread Matt Nathan (JIRA)
Matt Nathan created CAMEL-7247:
--

 Summary: No way to 'abort' the onCompletion action of the 
MailConsumer
 Key: CAMEL-7247
 URL: https://issues.apache.org/jira/browse/CAMEL-7247
 Project: Camel
  Issue Type: Improvement
  Components: camel-mail
Affects Versions: 2.12.2
Reporter: Matt Nathan


I have a route that reads from an email inbox, passes the message through a 
distributed IdempotentConsumer and then processes the mail if it's not been 
seen before.

The reason I have this setup is because we are running multiple instances of 
camel all pointing to the same inbox and don't mails to be processed more than 
once across the cluster.

Now leaving aside the fact that this may not be the best way to achieve what we 
want to do, the issue I have is that when the route completes, either by 
'aborting' as part of the IdempotentConsumer filtering or by processing the 
mail successfully, the completion listener added by the MailComponent always 
gets called.

This is not ideal because it effectively disables any rollback or reprocessing 
logic that may exist, and was even more problematic for us as we had 
delete=true set on the MailConsumer, which meant mails were removed under the 
feet of the node that was actually processing the mail.

What I'd like is a way for the route to complete successfully but for the 
MailComponent to not do anything to the mail. A state which is currently 
impossible without overriding the mail component (it either marks as deleted or 
marks as read, there is no 'don't do anything' option)



--
This message was sent by Atlassian JIRA
(v6.1.5#6160)


[jira] [Created] (CAMEL-7189) IAE when you have a nested placeholder that starts and ends with {{ and }}

2014-02-10 Thread Matt Nathan (JIRA)
Matt Nathan created CAMEL-7189:
--

 Summary: IAE when you have a nested placeholder that starts and 
ends with {{ and }}
 Key: CAMEL-7189
 URL: https://issues.apache.org/jira/browse/CAMEL-7189
 Project: Camel
  Issue Type: Bug
Affects Versions: 2.12.2
Reporter: Matt Nathan


Test case: https://gist.github.com/mattnathan/7706ebdce8aa51ebc3c6

When you have a uri that has a placeholder in it and that placeholder is of the 
form {{\{\{prefix\}\}something\{\{suffix\}\}}} then you get an 
IllegalArgumentException of the form:

{noformat}
org.apache.camel.FailedToCreateRouteException: Failed to create route route1 
at: >>> To[{{value}}] <<< in route: Route(route1)[[From[direct:test]] -> 
[To[{{value}}]]] because of Expecting }} but found end of string from text: 
scheme}}:{{path
at 
org.apache.camel.model.RouteDefinition.addRoutes(RouteDefinition.java:912)
at 
org.apache.camel.model.RouteDefinition.addRoutes(RouteDefinition.java:177)
at 
org.apache.camel.impl.DefaultCamelContext.startRoute(DefaultCamelContext.java:770)
at 
org.apache.camel.impl.DefaultCamelContext.startRouteDefinitions(DefaultCamelContext.java:1914)
at 
org.apache.camel.impl.DefaultCamelContext.doStartCamel(DefaultCamelContext.java:1670)
at 
org.apache.camel.impl.DefaultCamelContext.doStart(DefaultCamelContext.java:1544)
at org.apache.camel.support.ServiceSupport.start(ServiceSupport.java:61)
at 
org.apache.camel.impl.DefaultCamelContext.start(DefaultCamelContext.java:1512)
at 
org.apache.camel.test.junit4.CamelTestSupport.startCamelContext(CamelTestSupport.java:477)
at 
org.apache.camel.test.junit4.CamelTestSupport.doSetUp(CamelTestSupport.java:311)
at 
org.apache.camel.test.junit4.CamelTestSupport.setUp(CamelTestSupport.java:217)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at 
sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
at 
sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
at 
org.junit.runners.model.FrameworkMethod$1.runReflectiveCall(FrameworkMethod.java:47)
at 
org.junit.internal.runners.model.ReflectiveCallable.run(ReflectiveCallable.java:12)
at 
org.junit.runners.model.FrameworkMethod.invokeExplosively(FrameworkMethod.java:44)
at 
org.junit.internal.runners.statements.RunBefores.evaluate(RunBefores.java:24)
at 
org.junit.internal.runners.statements.RunAfters.evaluate(RunAfters.java:27)
at org.junit.rules.TestWatcher$1.evaluate(TestWatcher.java:55)
at org.junit.rules.RunRules.evaluate(RunRules.java:20)
at org.junit.runners.ParentRunner.runLeaf(ParentRunner.java:271)
at 
org.junit.runners.BlockJUnit4ClassRunner.runChild(BlockJUnit4ClassRunner.java:70)
at 
org.junit.runners.BlockJUnit4ClassRunner.runChild(BlockJUnit4ClassRunner.java:50)
at org.junit.runners.ParentRunner$3.run(ParentRunner.java:238)
at org.junit.runners.ParentRunner$1.schedule(ParentRunner.java:63)
at org.junit.runners.ParentRunner.runChildren(ParentRunner.java:236)
at org.junit.runners.ParentRunner.access$000(ParentRunner.java:53)
at org.junit.runners.ParentRunner$2.evaluate(ParentRunner.java:229)
at 
org.junit.internal.runners.statements.RunAfters.evaluate(RunAfters.java:27)
at org.junit.runners.ParentRunner.run(ParentRunner.java:309)
at org.junit.runner.JUnitCore.run(JUnitCore.java:160)
at 
com.intellij.junit4.JUnit4IdeaTestRunner.startRunnerWithArgs(JUnit4IdeaTestRunner.java:74)
at 
com.intellij.rt.execution.junit.JUnitStarter.prepareStreamsAndStart(JUnitStarter.java:202)
at 
com.intellij.rt.execution.junit.JUnitStarter.main(JUnitStarter.java:65)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at 
sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
at com.intellij.rt.execution.application.AppMain.main(AppMain.java:120)
Caused by: java.lang.IllegalArgumentException: Expecting }} but found end of 
string from text: scheme}}:{{path
at 
org.apache.camel.component.properties.DefaultPropertiesParser.doParseUri(DefaultPropertiesParser.java:90)
at 
org.apache.camel.component.properties.DefaultPropertiesParser.parseUri(DefaultPropertiesParser.java:51)
at 
org.apache.camel.component.properties.DefaultPropertiesParser.parseUri(DefaultPropertiesParser.java:38)
at 
org.apache.camel.component.properties.DefaultPropertiesParser.createPlaceholderPart(DefaultPropertiesParser.java:189)
at 
org.apache.camel.component.properties.DefaultPropertiesParser.doParseUri(DefaultPropertiesParser.java:105)
at 
org.apache.camel.component.properties.DefaultPropertiesParser.parseUri(DefaultPropertiesParser.java:51)
 

[jira] [Commented] (CAMEL-7125) tokenizeXml fails when attributes have a / in them

2014-01-10 Thread Matt Nathan (JIRA)

[ 
https://issues.apache.org/jira/browse/CAMEL-7125?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13868005#comment-13868005
 ] 

Matt Nathan commented on CAMEL-7125:


Fails in the same way (no message received) under: 2.12.2, 2.12.1, 2.12.0, 
2.11.2, 2.11.1

Fails with the following error under 2.11.0:

{noformat}
java.lang.AssertionError: mock://result Body of message: 0. Expected: <> but was: <>
at 
org.apache.camel.component.mock.MockEndpoint.fail(MockEndpoint.java:1318)
at 
org.apache.camel.component.mock.MockEndpoint.assertEquals(MockEndpoint.java:1300)
at 
org.apache.camel.component.mock.MockEndpoint$5.run(MockEndpoint.java:613)
at 
org.apache.camel.component.mock.MockEndpoint.doAssertIsSatisfied(MockEndpoint.java:383)
at 
org.apache.camel.component.mock.MockEndpoint.assertIsSatisfied(MockEndpoint.java:351)
at 
org.apache.camel.component.mock.MockEndpoint.assertIsSatisfied(MockEndpoint.java:339)
{noformat}

> tokenizeXml fails when attributes have a / in them
> --
>
> Key: CAMEL-7125
> URL: https://issues.apache.org/jira/browse/CAMEL-7125
> Project: Camel
>  Issue Type: Bug
>  Components: camel-core
>Affects Versions: 2.12.2
>Reporter: Matt Nathan
>
> {{tokenizeXml}} does not work or produce value xml output when attributes 
> contain a {{/}}.
> The test below will fail under 2.12.2
> {code:java}
> import org.apache.camel.EndpointInject;
> import org.apache.camel.Produce;
> import org.apache.camel.ProducerTemplate;
> import org.apache.camel.builder.RouteBuilder;
> import org.apache.camel.component.mock.MockEndpoint;
> import org.apache.camel.test.junit4.CamelTestSupport;
> import org.junit.Test;
> public class CamelTokenizeXmlTest extends CamelTestSupport {
>   @EndpointInject(uri = "mock:result")
>   protected MockEndpoint resultEndpoint;
>   @Produce(uri = "direct:start")
>   protected ProducerTemplate template;
>   @Test
>   public void testXmlWithSlash() throws Exception {
> String message = "";
> resultEndpoint.expectedBodiesReceived("");
> template.sendBody(message);
> resultEndpoint.assertIsSatisfied();
>   }
>   @Override
>   protected RouteBuilder createRouteBuilder() {
> return new RouteBuilder() {
>   @Override
>   public void configure() {
> from("direct:start").split().tokenizeXML("child").to("mock:result");
>   }
> };
>   }
> }
> {code}



--
This message was sent by Atlassian JIRA
(v6.1.5#6160)


[jira] [Created] (CAMEL-7125) tokenizeXml fails when attributes have a / in them

2014-01-10 Thread Matt Nathan (JIRA)
Matt Nathan created CAMEL-7125:
--

 Summary: tokenizeXml fails when attributes have a / in them
 Key: CAMEL-7125
 URL: https://issues.apache.org/jira/browse/CAMEL-7125
 Project: Camel
  Issue Type: Bug
  Components: camel-core
Affects Versions: 2.12.2
Reporter: Matt Nathan


{{tokenizeXml}} does not work or produce value xml output when attributes 
contain a {{/}}.

The test below will fail under 2.12.2

{code:java}
import org.apache.camel.EndpointInject;
import org.apache.camel.Produce;
import org.apache.camel.ProducerTemplate;
import org.apache.camel.builder.RouteBuilder;
import org.apache.camel.component.mock.MockEndpoint;
import org.apache.camel.test.junit4.CamelTestSupport;
import org.junit.Test;

public class CamelTokenizeXmlTest extends CamelTestSupport {

  @EndpointInject(uri = "mock:result")
  protected MockEndpoint resultEndpoint;
  @Produce(uri = "direct:start")
  protected ProducerTemplate template;

  @Test
  public void testXmlWithSlash() throws Exception {
String message = "";
resultEndpoint.expectedBodiesReceived("");
template.sendBody(message);
resultEndpoint.assertIsSatisfied();
  }

  @Override
  protected RouteBuilder createRouteBuilder() {
return new RouteBuilder() {
  @Override
  public void configure() {
from("direct:start").split().tokenizeXML("child").to("mock:result");
  }
};
  }
}
{code}



--
This message was sent by Atlassian JIRA
(v6.1.5#6160)