You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@camel.apache.org by GitBox <gi...@apache.org> on 2021/04/11 13:26:04 UTC

[GitHub] [camel] dschulten opened a new pull request #5332: [CAMEL-16449]: Introduces ContentBasedServiceFilter

dschulten opened a new pull request #5332:
URL: https://github.com/apache/camel/pull/5332


   fixes https://issues.apache.org/jira/browse/CAMEL-16449
   
   Main goal: pass the current exchange to `ServiceFilter.apply` without breaking existing `ServiceFilter` and `ServiceLoadBalancer` implementations. Make it as convenient as possible to implement service filters with access to the current exchange.
   
   Trade-off: the old method cannot be executed upwards-compatibly on the new `ContentBasedServiceFilter`. Hence the implementation is a bit more convoluted than I would like it to be.
   
   Implementation steps:
   
   1. ​Introduce new `ServiceFilter.apply(exchange, services)` method with default impl that calls the old apply method without passing the exchange
   2. Introduce new ServiceLoadBalancer.process(exchange, serviceName, serviceLoadBalancerFunction) method with default impl that calls the old process method without passing the exchange
   3. Call the new ServiceFilter.apply method from new DefaultLoadBalancer.process method
   4. Let the old `DefaultLoadBalancer.process` method call the new one, passing a `null` exchange. The old method cannot throw an exception since that would break existing `ServiceLoadBalancer` impls. I pass `null`, but it should never be passed on to actual service filters because of the next step:
   5. The default ServiceFilter.apply(exchange, services) method calls the old apply(services) without passing the `null` exchange, so that existing ServiceFilter and ServiceLoadBalancer impls remain compatible and the `null` exchange should usually not be encountered anywhere at runtime. 
   5. Introduce new functional interface `ContentBasedServiceFilter` with a `ContentBasedServiceFilterAdapter` so that users can write a lambda based `ContentBasedServiceFilter` which is also a ServiceFilter (see `LoadBalancerTest#testLoadBalancerWithContentBasedServiceFilter)`
   6. `ContentBasedServiceFilterAdapter` throws an exception if its old `apply(services)` method gets called, so that people who try to run a `ContentBasedServiceFilter` without passing an exchange are being told that this filter requires an exchange and that they might have to adjust their custom `ServiceLoadBalancer`.


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

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



[GitHub] [camel] dschulten edited a comment on pull request #5332: [CAMEL-16449]: Introduces ContentBasedServiceFilter

Posted by GitBox <gi...@apache.org>.
dschulten edited a comment on pull request #5332:
URL: https://github.com/apache/camel/pull/5332#issuecomment-821819464


   Please review the reworked feature, check is green now.
   
   I have changed the `ServiceFilter` implementation so that it takes the current exchange, breaking existing third-party `ServiceFilter` implementations as suggested.
   
   `RibbonServiceLoadBalancer` uses a Netflix `ZoneAwareLoadBalancer` which has no concept of a current exchange, so it can't pass the current exchange into `ServiceFilter`. I now pass a `DefaultExchange` to the server filter in `RibbonServerList`. I had to add com.netflix.servo:servo-core:0.10.1 as a provided dependency and the servo version to parent/pom properties because I got the following error (servo-core is only a runtime dependency of com.netflix.ribbon:ribbon-loadbalancer, but for some reason becomes required at compile time once you add a `DefaultExchange` to the `RibbonServerList`):
   
   ```
   Error:  Failed to execute goal org.apache.maven.plugins:maven-compiler-plugin:3.8.1:compile (default-compile) on project camel-ribbon: Compilation failure: Compilation failure: 
   Error:  /home/runner/work/camel/camel/components/camel-ribbon/src/main/java/org/apache/camel/component/ribbon/cloud/RibbonServiceLoadBalancer.java:[47,28] error: cannot find symbol
   Error:    symbol:   class DefaultCamelContext
   Error:    location: package org.apache.camel.impl
   Error:    reason: class file for com.netflix.servo.annotations.DataSourceType not found
   Error:  warning: unknown enum constant DataSourceType.GAUGE
   Error:  warning: unknown enum constant DataSourceType.GAUGE
   Error:  warning: unknown enum constant DataSourceType.GAUGE
   Error:  warning: unknown enum constant DataSourceType.INFORMATIONAL
   Error:  warning: unknown enum constant DataSourceType.INFORMATIONAL
   Error:  /home/runner/work/camel/camel/components/camel-ribbon/src/main/java/org/apache/camel/component/ribbon/cloud/RibbonServiceLoadBalancer.java:[213,57] error: cannot find symbol
   Error:    symbol:   class DefaultCamelContext
   Error:    location: class RibbonServerList
   ```


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

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



[GitHub] [camel] davsclaus commented on pull request #5332: [CAMEL-16449]: Introduces ContentBasedServiceFilter

Posted by GitBox <gi...@apache.org>.
davsclaus commented on pull request #5332:
URL: https://github.com/apache/camel/pull/5332#issuecomment-819366604


   Sorry for the delay in feedback.
   
   At first glance, I wonder if the existing API / implementations, could be modified to take `Exchange` as a parameter.
   Then there is no need to introduce new methods etc.
   
   This is very seldome for end user to build custom service filters (as you do) and if they are then its an easy migration effort. Just add `Exchange` as parameter, and you dont need to use it if you dont need it.


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

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



[GitHub] [camel] dschulten edited a comment on pull request #5332: [CAMEL-16449]: Introduces ContentBasedServiceFilter

Posted by GitBox <gi...@apache.org>.
dschulten edited a comment on pull request #5332:
URL: https://github.com/apache/camel/pull/5332#issuecomment-821819464


   Please review the reworked feature, check is green now.
   
   I have changed the `ServiceFilter` implementation so that it takes the current exchange, breaking existing `ServiceFilter` implementations as suggested.
   
   `RibbonServiceLoadBalancer` uses a Netflix `ZoneAwareLoadBalancer` which has no concept of a current exchange, so it can't pass the current exchange into `ServiceFilter`. I now pass a `DefaultExchange` to the server filter in `RibbonServerList`. I had to add com.netflix.servo:servo-core:0.10.1 as a provided dependency and the servo version to parent/pom properties because I got the following error (servo-core is only a runtime dependency of com.netflix.ribbon:ribbon-loadbalancer, but for some reason becomes required at compile time once you add a `DefaultExchange` to the `RibbonServerList`):
   
   ```
   Error:  Failed to execute goal org.apache.maven.plugins:maven-compiler-plugin:3.8.1:compile (default-compile) on project camel-ribbon: Compilation failure: Compilation failure: 
   Error:  /home/runner/work/camel/camel/components/camel-ribbon/src/main/java/org/apache/camel/component/ribbon/cloud/RibbonServiceLoadBalancer.java:[47,28] error: cannot find symbol
   Error:    symbol:   class DefaultCamelContext
   Error:    location: package org.apache.camel.impl
   Error:    reason: class file for com.netflix.servo.annotations.DataSourceType not found
   Error:  warning: unknown enum constant DataSourceType.GAUGE
   Error:  warning: unknown enum constant DataSourceType.GAUGE
   Error:  warning: unknown enum constant DataSourceType.GAUGE
   Error:  warning: unknown enum constant DataSourceType.INFORMATIONAL
   Error:  warning: unknown enum constant DataSourceType.INFORMATIONAL
   Error:  /home/runner/work/camel/camel/components/camel-ribbon/src/main/java/org/apache/camel/component/ribbon/cloud/RibbonServiceLoadBalancer.java:[213,57] error: cannot find symbol
   Error:    symbol:   class DefaultCamelContext
   Error:    location: class RibbonServerList
   ```


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

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



[GitHub] [camel] dschulten commented on pull request #5332: [CAMEL-16449]: Introduces ContentBasedServiceFilter

Posted by GitBox <gi...@apache.org>.
dschulten commented on pull request #5332:
URL: https://github.com/apache/camel/pull/5332#issuecomment-820906456


   Ok, that change should be easy.


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

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



[GitHub] [camel] dschulten edited a comment on pull request #5332: [CAMEL-16449]: Introduces ContentBasedServiceFilter

Posted by GitBox <gi...@apache.org>.
dschulten edited a comment on pull request #5332:
URL: https://github.com/apache/camel/pull/5332#issuecomment-821819464


   Please review the reworked feature, check is green now.
   
   I have changed the `ServiceFilter` implementation so that it takes the current exchange now, breaking existing `ServiceFilter` implementations as suggested.
   
   `RibbonServiceLoadBalancer` uses a Netflix `ZoneAwareLoadBalancer` which has no concept of a current exchange, so it can't pass the current exchange into `ServiceFilter`. I now pass a `DefaultExchange` to the server filter in `RibbonServerList`. I had to add com.netflix.servo:servo-core:0.10.1 as a provided dependency and the servo version to parent/pom properties because I got the following error (servo-core is only a runtime dependency of com.netflix.ribbon:ribbon-loadbalancer, but for some reason becomes required at compile time once you add a `DefaultExchange` to the `RibbonServerList`):
   
   ```
   Error:  Failed to execute goal org.apache.maven.plugins:maven-compiler-plugin:3.8.1:compile (default-compile) on project camel-ribbon: Compilation failure: Compilation failure: 
   Error:  /home/runner/work/camel/camel/components/camel-ribbon/src/main/java/org/apache/camel/component/ribbon/cloud/RibbonServiceLoadBalancer.java:[47,28] error: cannot find symbol
   Error:    symbol:   class DefaultCamelContext
   Error:    location: package org.apache.camel.impl
   Error:    reason: class file for com.netflix.servo.annotations.DataSourceType not found
   Error:  warning: unknown enum constant DataSourceType.GAUGE
   Error:  warning: unknown enum constant DataSourceType.GAUGE
   Error:  warning: unknown enum constant DataSourceType.GAUGE
   Error:  warning: unknown enum constant DataSourceType.INFORMATIONAL
   Error:  warning: unknown enum constant DataSourceType.INFORMATIONAL
   Error:  /home/runner/work/camel/camel/components/camel-ribbon/src/main/java/org/apache/camel/component/ribbon/cloud/RibbonServiceLoadBalancer.java:[213,57] error: cannot find symbol
   Error:    symbol:   class DefaultCamelContext
   Error:    location: class RibbonServerList
   ```


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

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



[GitHub] [camel] davsclaus commented on pull request #5332: [CAMEL-16449]: Introduces ContentBasedServiceFilter

Posted by GitBox <gi...@apache.org>.
davsclaus commented on pull request #5332:
URL: https://github.com/apache/camel/pull/5332#issuecomment-820949018


   In the 3.10 upgrade doc
   https://github.com/apache/camel/blob/master/docs/user-manual/modules/ROOT/pages/camel-3x-upgrade-guide-3_10.adoc
   


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

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



[GitHub] [camel] dschulten edited a comment on pull request #5332: [CAMEL-16449]: Introduces ContentBasedServiceFilter

Posted by GitBox <gi...@apache.org>.
dschulten edited a comment on pull request #5332:
URL: https://github.com/apache/camel/pull/5332#issuecomment-821819464


   I have changed the ServiceFilter implementation so that it takes the current exchange now, breaking existing `ServiceFilter` implementations as suggested.
   
   `RibbonServiceLoadBalancer` uses a Netflix `ZoneAwareLoadBalancer` which has no concept of a current exchange, so it can't pass the current exchange into `ServiceFilter`. I now pass a dummy exchange to the server filter in `RibbonServerList`. I had to create a `DummyExchange` class since the `DefaultExchange` did not work - the build complained about a missing `com.netflix.servo.annotations.DataSourceType` class file (a runtime scope dependency of ribbon-loadbalancer) which I have been unable to resolve so far (unless I add servo-core as a compile or provided dependency, but I didn't want to change the ribbon dependencies without discussing it first):
   
   ```
   Error:  Failed to execute goal org.apache.maven.plugins:maven-compiler-plugin:3.8.1:compile (default-compile) on project camel-ribbon: Compilation failure: Compilation failure: 
   Error:  /home/runner/work/camel/camel/components/camel-ribbon/src/main/java/org/apache/camel/component/ribbon/cloud/RibbonServiceLoadBalancer.java:[47,28] error: cannot find symbol
   Error:    symbol:   class DefaultCamelContext
   Error:    location: package org.apache.camel.impl
   Error:    reason: class file for com.netflix.servo.annotations.DataSourceType not found
   Error:  warning: unknown enum constant DataSourceType.GAUGE
   Error:  warning: unknown enum constant DataSourceType.GAUGE
   Error:  warning: unknown enum constant DataSourceType.GAUGE
   Error:  warning: unknown enum constant DataSourceType.INFORMATIONAL
   Error:  warning: unknown enum constant DataSourceType.INFORMATIONAL
   Error:  /home/runner/work/camel/camel/components/camel-ribbon/src/main/java/org/apache/camel/component/ribbon/cloud/RibbonServiceLoadBalancer.java:[213,57] error: cannot find symbol
   Error:    symbol:   class DefaultCamelContext
   Error:    location: class RibbonServerList
   ```


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

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



[GitHub] [camel] dschulten edited a comment on pull request #5332: [CAMEL-16449]: Introduces ContentBasedServiceFilter

Posted by GitBox <gi...@apache.org>.
dschulten edited a comment on pull request #5332:
URL: https://github.com/apache/camel/pull/5332#issuecomment-820923786


   Where should I document the change, in camel\core\camel-core-engine\src\main\docs\modules\eips\pages\serviceCall-eip.adoc? Are there also migration notes for the incompatible change, and if so, where?


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

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



[GitHub] [camel] dschulten edited a comment on pull request #5332: [CAMEL-16449]: Introduces ContentBasedServiceFilter

Posted by GitBox <gi...@apache.org>.
dschulten edited a comment on pull request #5332:
URL: https://github.com/apache/camel/pull/5332#issuecomment-821819464


   I have changed the `ServiceFilter` implementation so that it takes the current exchange now, breaking existing `ServiceFilter` implementations as suggested.
   
   `RibbonServiceLoadBalancer` uses a Netflix `ZoneAwareLoadBalancer` which has no concept of a current exchange, so it can't pass the current exchange into `ServiceFilter`. I now pass a `DefaultExchange` to the server filter in `RibbonServerList`. I had to add com.netflix.servo:servo-core:0.10.1 as a provided dependency and add the servo version to parent/pom properties because I got the following error (servo-core is only a runtime dependency of com.netflix.ribbon:ribbon-loadbalancer, but for some reason becomes required at compile time once you add a `DefaultExchange` to the `RibbonServerList`):
   
   ```
   Error:  Failed to execute goal org.apache.maven.plugins:maven-compiler-plugin:3.8.1:compile (default-compile) on project camel-ribbon: Compilation failure: Compilation failure: 
   Error:  /home/runner/work/camel/camel/components/camel-ribbon/src/main/java/org/apache/camel/component/ribbon/cloud/RibbonServiceLoadBalancer.java:[47,28] error: cannot find symbol
   Error:    symbol:   class DefaultCamelContext
   Error:    location: package org.apache.camel.impl
   Error:    reason: class file for com.netflix.servo.annotations.DataSourceType not found
   Error:  warning: unknown enum constant DataSourceType.GAUGE
   Error:  warning: unknown enum constant DataSourceType.GAUGE
   Error:  warning: unknown enum constant DataSourceType.GAUGE
   Error:  warning: unknown enum constant DataSourceType.INFORMATIONAL
   Error:  warning: unknown enum constant DataSourceType.INFORMATIONAL
   Error:  /home/runner/work/camel/camel/components/camel-ribbon/src/main/java/org/apache/camel/component/ribbon/cloud/RibbonServiceLoadBalancer.java:[213,57] error: cannot find symbol
   Error:    symbol:   class DefaultCamelContext
   Error:    location: class RibbonServerList
   ```


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

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



[GitHub] [camel] dschulten commented on pull request #5332: [CAMEL-16449]: Introduces ContentBasedServiceFilter

Posted by GitBox <gi...@apache.org>.
dschulten commented on pull request #5332:
URL: https://github.com/apache/camel/pull/5332#issuecomment-820923786


   Where should I document the change, in camel\core\camel-core-engine\src\main\docs\modules\eips\pages\serviceCall-eip.adoc?


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

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



[GitHub] [camel] davsclaus merged pull request #5332: [CAMEL-16449]: Introduces ContentBasedServiceFilter

Posted by GitBox <gi...@apache.org>.
davsclaus merged pull request #5332:
URL: https://github.com/apache/camel/pull/5332


   


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

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



[GitHub] [camel] dschulten edited a comment on pull request #5332: [CAMEL-16449]: Introduces ContentBasedServiceFilter

Posted by GitBox <gi...@apache.org>.
dschulten edited a comment on pull request #5332:
URL: https://github.com/apache/camel/pull/5332#issuecomment-821819464


   I have changed the ServiceFilter implementation so that it takes the current exchange now, breaking existing `ServiceFilter` implementations as suggested.
   
   `RibbonServiceLoadBalancer` uses a Netflix `ZoneAwareLoadBalancer` which has no concept of a current exchange, so it can't pass the current exchange into `ServiceFilter`. I now pass a dummy exchange to the server filter in `RibbonServerList`. I had to create a `DummyExchange` class since the `DefaultExchange` did not work - the build complained about a missing `com.netflix.servo.annotations.DataSourceType` class file (a runtime scope dependency of ribbon-loadbalancer) which I have been unable to resolve so far:
   
   ```
   Error:  Failed to execute goal org.apache.maven.plugins:maven-compiler-plugin:3.8.1:compile (default-compile) on project camel-ribbon: Compilation failure: Compilation failure: 
   Error:  /home/runner/work/camel/camel/components/camel-ribbon/src/main/java/org/apache/camel/component/ribbon/cloud/RibbonServiceLoadBalancer.java:[47,28] error: cannot find symbol
   Error:    symbol:   class DefaultCamelContext
   Error:    location: package org.apache.camel.impl
   Error:    reason: class file for com.netflix.servo.annotations.DataSourceType not found
   Error:  warning: unknown enum constant DataSourceType.GAUGE
   Error:  warning: unknown enum constant DataSourceType.GAUGE
   Error:  warning: unknown enum constant DataSourceType.GAUGE
   Error:  warning: unknown enum constant DataSourceType.INFORMATIONAL
   Error:  warning: unknown enum constant DataSourceType.INFORMATIONAL
   Error:  /home/runner/work/camel/camel/components/camel-ribbon/src/main/java/org/apache/camel/component/ribbon/cloud/RibbonServiceLoadBalancer.java:[213,57] error: cannot find symbol
   Error:    symbol:   class DefaultCamelContext
   Error:    location: class RibbonServerList
   ```


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

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



[GitHub] [camel] dschulten edited a comment on pull request #5332: [CAMEL-16449]: Introduces ContentBasedServiceFilter

Posted by GitBox <gi...@apache.org>.
dschulten edited a comment on pull request #5332:
URL: https://github.com/apache/camel/pull/5332#issuecomment-821819464


   I have changed the `ServiceFilter` implementation so that it takes the current exchange now, breaking existing `ServiceFilter` implementations as suggested.
   
   `RibbonServiceLoadBalancer` uses a Netflix `ZoneAwareLoadBalancer` which has no concept of a current exchange, so it can't pass the current exchange into `ServiceFilter`. I now pass a dummy exchange to the server filter in `RibbonServerList`. I had to create a `DummyExchange` class since the `DefaultExchange` did not work - the build complained about a missing `com.netflix.servo.annotations.DataSourceType` class file (a runtime scope dependency of com.netflix.ribbon:ribbon-loadbalancer) which I have been unable to resolve so far (unless I add com.netflix.servo:servo-core:0.10.1 as a provided dependency and add the servo version to parent/pom properties, but I didn't want to change the camel-ribbon dependencies without discussing it first):
   
   ```
   Error:  Failed to execute goal org.apache.maven.plugins:maven-compiler-plugin:3.8.1:compile (default-compile) on project camel-ribbon: Compilation failure: Compilation failure: 
   Error:  /home/runner/work/camel/camel/components/camel-ribbon/src/main/java/org/apache/camel/component/ribbon/cloud/RibbonServiceLoadBalancer.java:[47,28] error: cannot find symbol
   Error:    symbol:   class DefaultCamelContext
   Error:    location: package org.apache.camel.impl
   Error:    reason: class file for com.netflix.servo.annotations.DataSourceType not found
   Error:  warning: unknown enum constant DataSourceType.GAUGE
   Error:  warning: unknown enum constant DataSourceType.GAUGE
   Error:  warning: unknown enum constant DataSourceType.GAUGE
   Error:  warning: unknown enum constant DataSourceType.INFORMATIONAL
   Error:  warning: unknown enum constant DataSourceType.INFORMATIONAL
   Error:  /home/runner/work/camel/camel/components/camel-ribbon/src/main/java/org/apache/camel/component/ribbon/cloud/RibbonServiceLoadBalancer.java:[213,57] error: cannot find symbol
   Error:    symbol:   class DefaultCamelContext
   Error:    location: class RibbonServerList
   ```


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

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



[GitHub] [camel] dschulten edited a comment on pull request #5332: [CAMEL-16449]: Introduces ContentBasedServiceFilter

Posted by GitBox <gi...@apache.org>.
dschulten edited a comment on pull request #5332:
URL: https://github.com/apache/camel/pull/5332#issuecomment-821819464


   I have changed the ServiceFilter implementation so that it takes the current exchange now, breaking existing `ServiceFilter` implementations as suggested.
   
   `RibbonServiceLoadBalancer` uses a Netflix `ZoneAwareLoadBalancer` which has no concept of a current exchange, so it can't pass the current exchange into `ServiceFilter`. I now pass a dummy exchange to the server filter in `RibbonServerList`. I had to create a `DummyExchange` class since the `DefaultExchange` did not work - the build complained about a missing `com.netflix.servo.annotations.DataSourceType` class file which I was unable to resolve:
   
   ```
   Error:  Failed to execute goal org.apache.maven.plugins:maven-compiler-plugin:3.8.1:compile (default-compile) on project camel-ribbon: Compilation failure: Compilation failure: 
   Error:  /home/runner/work/camel/camel/components/camel-ribbon/src/main/java/org/apache/camel/component/ribbon/cloud/RibbonServiceLoadBalancer.java:[47,28] error: cannot find symbol
   Error:    symbol:   class DefaultCamelContext
   Error:    location: package org.apache.camel.impl
   Error:    reason: class file for com.netflix.servo.annotations.DataSourceType not found
   Error:  warning: unknown enum constant DataSourceType.GAUGE
   Error:  warning: unknown enum constant DataSourceType.GAUGE
   Error:  warning: unknown enum constant DataSourceType.GAUGE
   Error:  warning: unknown enum constant DataSourceType.INFORMATIONAL
   Error:  warning: unknown enum constant DataSourceType.INFORMATIONAL
   Error:  /home/runner/work/camel/camel/components/camel-ribbon/src/main/java/org/apache/camel/component/ribbon/cloud/RibbonServiceLoadBalancer.java:[213,57] error: cannot find symbol
   Error:    symbol:   class DefaultCamelContext
   Error:    location: class RibbonServerList
   ```


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

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



[GitHub] [camel] dschulten edited a comment on pull request #5332: [CAMEL-16449]: Introduces ContentBasedServiceFilter

Posted by GitBox <gi...@apache.org>.
dschulten edited a comment on pull request #5332:
URL: https://github.com/apache/camel/pull/5332#issuecomment-821819464


   I have changed the `ServiceFilter` implementation so that it takes the current exchange now, breaking existing `ServiceFilter` implementations as suggested.
   
   `RibbonServiceLoadBalancer` uses a Netflix `ZoneAwareLoadBalancer` which has no concept of a current exchange, so it can't pass the current exchange into `ServiceFilter`. I now pass a `DefaultExchange` to the server filter in `RibbonServerList`. I had to add com.netflix.servo:servo-core:0.10.1 as a provided dependency and the servo version to parent/pom properties because I got the following error (servo-core is only a runtime dependency of com.netflix.ribbon:ribbon-loadbalancer, but for some reason becomes required at compile time once you add a `DefaultExchange` to the `RibbonServerList`):
   
   ```
   Error:  Failed to execute goal org.apache.maven.plugins:maven-compiler-plugin:3.8.1:compile (default-compile) on project camel-ribbon: Compilation failure: Compilation failure: 
   Error:  /home/runner/work/camel/camel/components/camel-ribbon/src/main/java/org/apache/camel/component/ribbon/cloud/RibbonServiceLoadBalancer.java:[47,28] error: cannot find symbol
   Error:    symbol:   class DefaultCamelContext
   Error:    location: package org.apache.camel.impl
   Error:    reason: class file for com.netflix.servo.annotations.DataSourceType not found
   Error:  warning: unknown enum constant DataSourceType.GAUGE
   Error:  warning: unknown enum constant DataSourceType.GAUGE
   Error:  warning: unknown enum constant DataSourceType.GAUGE
   Error:  warning: unknown enum constant DataSourceType.INFORMATIONAL
   Error:  warning: unknown enum constant DataSourceType.INFORMATIONAL
   Error:  /home/runner/work/camel/camel/components/camel-ribbon/src/main/java/org/apache/camel/component/ribbon/cloud/RibbonServiceLoadBalancer.java:[213,57] error: cannot find symbol
   Error:    symbol:   class DefaultCamelContext
   Error:    location: class RibbonServerList
   ```


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

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



[GitHub] [camel] dschulten edited a comment on pull request #5332: [CAMEL-16449]: Introduces ContentBasedServiceFilter

Posted by GitBox <gi...@apache.org>.
dschulten edited a comment on pull request #5332:
URL: https://github.com/apache/camel/pull/5332#issuecomment-821819464


   I have changed the `ServiceFilter` implementation so that it takes the current exchange now, breaking existing `ServiceFilter` implementations as suggested.
   
   `RibbonServiceLoadBalancer` uses a Netflix `ZoneAwareLoadBalancer` which has no concept of a current exchange, so it can't pass the current exchange into `ServiceFilter`. I now pass a dummy exchange to the server filter in `RibbonServerList`. I had to create a `DummyExchange` class since the `DefaultExchange` did not work - the build complained about a missing `com.netflix.servo.annotations.DataSourceType` class file (a runtime scope dependency of com.netflix.ribbon:ribbon-loadbalancer) which I have been unable to resolve so far (unless I add com.netflix.servo:servo-core:0.10.1 as a compile or provided dependency, but I didn't want to change the camel-ribbon dependencies without discussing it first):
   
   ```
   Error:  Failed to execute goal org.apache.maven.plugins:maven-compiler-plugin:3.8.1:compile (default-compile) on project camel-ribbon: Compilation failure: Compilation failure: 
   Error:  /home/runner/work/camel/camel/components/camel-ribbon/src/main/java/org/apache/camel/component/ribbon/cloud/RibbonServiceLoadBalancer.java:[47,28] error: cannot find symbol
   Error:    symbol:   class DefaultCamelContext
   Error:    location: package org.apache.camel.impl
   Error:    reason: class file for com.netflix.servo.annotations.DataSourceType not found
   Error:  warning: unknown enum constant DataSourceType.GAUGE
   Error:  warning: unknown enum constant DataSourceType.GAUGE
   Error:  warning: unknown enum constant DataSourceType.GAUGE
   Error:  warning: unknown enum constant DataSourceType.INFORMATIONAL
   Error:  warning: unknown enum constant DataSourceType.INFORMATIONAL
   Error:  /home/runner/work/camel/camel/components/camel-ribbon/src/main/java/org/apache/camel/component/ribbon/cloud/RibbonServiceLoadBalancer.java:[213,57] error: cannot find symbol
   Error:    symbol:   class DefaultCamelContext
   Error:    location: class RibbonServerList
   ```


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

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



[GitHub] [camel] dschulten commented on pull request #5332: [CAMEL-16449]: Introduces ContentBasedServiceFilter

Posted by GitBox <gi...@apache.org>.
dschulten commented on pull request #5332:
URL: https://github.com/apache/camel/pull/5332#issuecomment-821819464


   `RibbonServiceLoadBalancer` uses a Netflix `ZoneAwareLoadBalancer` which has no concept of a current exchange, so it cant pass the current exchange into `ServiceFilter`. I now pass a dummy exchange to the server filter in `RibbonServerList`. I had to create a `DummyExchange` class since the `DefaultExchange` did not work - the build complained about a missing `com.netflix.servo.annotations.DataSourceType` class file which I was unable to resolve:
   
   ```
   Error:  Failed to execute goal org.apache.maven.plugins:maven-compiler-plugin:3.8.1:compile (default-compile) on project camel-ribbon: Compilation failure: Compilation failure: 
   Error:  /home/runner/work/camel/camel/components/camel-ribbon/src/main/java/org/apache/camel/component/ribbon/cloud/RibbonServiceLoadBalancer.java:[47,28] error: cannot find symbol
   Error:    symbol:   class DefaultCamelContext
   Error:    location: package org.apache.camel.impl
   Error:    reason: class file for com.netflix.servo.annotations.DataSourceType not found
   Error:  warning: unknown enum constant DataSourceType.GAUGE
   Error:  warning: unknown enum constant DataSourceType.GAUGE
   Error:  warning: unknown enum constant DataSourceType.GAUGE
   Error:  warning: unknown enum constant DataSourceType.INFORMATIONAL
   Error:  warning: unknown enum constant DataSourceType.INFORMATIONAL
   Error:  /home/runner/work/camel/camel/components/camel-ribbon/src/main/java/org/apache/camel/component/ribbon/cloud/RibbonServiceLoadBalancer.java:[213,57] error: cannot find symbol
   Error:    symbol:   class DefaultCamelContext
   Error:    location: class RibbonServerList
   ```


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

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