Re: Endpoint trying to create additional consumers for URIs with paths

2022-01-21 Thread Steve973
Let me clarify: I understand that I can create another component class for
the control channel, and its corresponding endpoint class.  But I need the
two types to be able to interact; when I get a control channel message, I
need to be able to register a message filter with the dynamic router
component.  So that is specifically where my disconnect is, at the moment.

Thanks again,
Steve

On Fri, Jan 21, 2022 at 6:02 PM Steve973  wrote:

> Hi, Claus.  I am going with your suggestion to create a separate endpoint
> for the control channel.  I am having a little trouble being able to create
> the endpoint for the control channel.  Camel is complaining that "No
> endpoint could be found for: dynamic-router-control://, please check your
> classpath contains the needed Camel component jar."  How can I define two
> schemes?
>
> Thanks,
> Steve
>
> On Tue, Jan 18, 2022 at 3:00 AM Claus Ibsen  wrote:
>
>> Hi
>>
>> No this is not really how an endpoint is designed. Each endpoint is
>> responsible for creating its consumer/producers.
>> However a consumer / producer may use some shared entity, such as seda
>> does with its queues.
>>
>> Maybe what you are trying is to shoe-horn everything into the same
>> endpoint.
>>
>> For your dynamic router component, maybe you have one endpoint for the
>> control channel and another for the dynamic router, where they have
>> different name
>>
>> dynamic-router:name
>> dynamic-router-control:name/action/param
>>
>> However coming back to using one endpoint. Then I dont think it makes
>> sense for a control channel message to be able to create a consumer
>> Then you can just in case someone attempts to use it wrongly throw an
>> exception in createConsumer
>>
>> dynamic-router:control/subscribe/123?filter=${body} contains 'red'
>>
>> from dynamic-router:123
>>   to bean:reds
>>
>>
>>
>>
>> On Mon, Jan 17, 2022 at 7:37 PM Steve973  wrote:
>> >
>> > I have added path params to the URI for certain conditions of my
>> > component.  The normal use case would have a URI like:
>> > my-component://name.  Now there is another use case where I can specify
>> a
>> > URI like: my-component://name//param.  In this case, "action"
>> can
>> > have different values.  But I only want to add a consumer for the name
>> > (once), even if multiple URIs are used where the name is the same, but
>> the
>> > action is different.  In the component class, in the createEndpoint()
>> > method, I can make sure that I instantiate the Endpoint with the URI
>> > truncated after the name, but it still results in an attempt to add
>> another
>> > consumer if an endpoint has been previously created for that name (with
>> a
>> > different action).  Is there a way to stop creating new Endpoints for
>> > different path parameters, and only care about the base URI?
>> >
>> > Thanks,
>> > Steve
>>
>>
>>
>> --
>> Claus Ibsen
>> -
>> http://davsclaus.com @davsclaus
>> Camel in Action 2: https://www.manning.com/ibsen2
>>
>


Re: Endpoint trying to create additional consumers for URIs with paths

2022-01-21 Thread Steve973
Hi, Claus.  I am going with your suggestion to create a separate endpoint
for the control channel.  I am having a little trouble being able to create
the endpoint for the control channel.  Camel is complaining that "No
endpoint could be found for: dynamic-router-control://, please check your
classpath contains the needed Camel component jar."  How can I define two
schemes?

Thanks,
Steve

On Tue, Jan 18, 2022 at 3:00 AM Claus Ibsen  wrote:

> Hi
>
> No this is not really how an endpoint is designed. Each endpoint is
> responsible for creating its consumer/producers.
> However a consumer / producer may use some shared entity, such as seda
> does with its queues.
>
> Maybe what you are trying is to shoe-horn everything into the same
> endpoint.
>
> For your dynamic router component, maybe you have one endpoint for the
> control channel and another for the dynamic router, where they have
> different name
>
> dynamic-router:name
> dynamic-router-control:name/action/param
>
> However coming back to using one endpoint. Then I dont think it makes
> sense for a control channel message to be able to create a consumer
> Then you can just in case someone attempts to use it wrongly throw an
> exception in createConsumer
>
> dynamic-router:control/subscribe/123?filter=${body} contains 'red'
>
> from dynamic-router:123
>   to bean:reds
>
>
>
>
> On Mon, Jan 17, 2022 at 7:37 PM Steve973  wrote:
> >
> > I have added path params to the URI for certain conditions of my
> > component.  The normal use case would have a URI like:
> > my-component://name.  Now there is another use case where I can specify a
> > URI like: my-component://name//param.  In this case, "action" can
> > have different values.  But I only want to add a consumer for the name
> > (once), even if multiple URIs are used where the name is the same, but
> the
> > action is different.  In the component class, in the createEndpoint()
> > method, I can make sure that I instantiate the Endpoint with the URI
> > truncated after the name, but it still results in an attempt to add
> another
> > consumer if an endpoint has been previously created for that name (with a
> > different action).  Is there a way to stop creating new Endpoints for
> > different path parameters, and only care about the base URI?
> >
> > Thanks,
> > Steve
>
>
>
> --
> Claus Ibsen
> -
> http://davsclaus.com @davsclaus
> Camel in Action 2: https://www.manning.com/ibsen2
>


Re: Camel-K integration status phases

2022-01-21 Thread Pasquale Congiusti
Hi Roberto,
you can find the list of constant used here:
https://github.com/apache/camel-k/blob/main/pkg/apis/camel/v1/integration_types.go#L120-L132

Cheers,
Pasquale.

On Fri, Jan 21, 2022 at 12:27 PM Roberto Camelk <
betonetotbo.cam...@gmail.com> wrote:

> What are the values of integration status phases?
>
> In the API documentation this field is a "string", so anything is
> possible ehehehe...
>
> Here is an sample about the output of the "get integration" that am I
> using to map this "status.phase" to a enumeration inside my
> application:
>
> kubectl get integration micro-profile-metrics2 -o yaml
>
> apiVersion: camel.apache.org/v1
> kind: Integration
> metadata:
>   creationTimestamp: "2021-12-22T14:31:27Z"
>   generation: 1
>   name: micro-profile-metrics2
>   namespace: default
>   resourceVersion: "361241"
>   uid: 89de44cc-0b85-48ae-9198-b88287e89805
> spec:
>   dependencies:
>   - camel:cron
>   - camel:microprofile-metrics
>   sources:
>   - content: "//camel-k: dependency=camel-cron\n//camel-k:
> dependency=camel-quarkus-microprofile-metrics\n\nimport
>   org.apache.camel.builder.RouteBuilder;\n\npublic class
> MicroProfileMetrics2
>   extends RouteBuilder {\n\n@Override\npublic void
> configure() throws
>   Exception
>
> {\n\tfrom(\"cron:tab?schedule=0/15+*+*+*+*+?\")\n\t\t.routeId(\"metrics\")\n\t\t.log(\"Starting
>   MicroProfile
>
> Metrics\")\n\t\t.delay(simple(\"${random(1000,5000)}\"))\n\t\t.choice()\n\t\t\t.when().simple(\"${random(1,10)}
>   < 2\")\n\t\t\t\t.throwException(new
>
> RuntimeException(\"Perdeu\"))\n\t\t\t.otherwise()\n\t\t\t\t.log(\"MicroProfile
>   Metrics sample done!\");\n}\n\n}\n"
> name: MicroProfileMetrics2.java
>   traits:
> logging:
>   configuration:
> level: TRACE
> prometheus:
>   configuration:
> enabled: true
> status:
>   capabilities:
>   - cron
>   conditions:
>   - firstTruthyTime: "2021-12-22T14:31:27Z"
> lastTransitionTime: "2021-12-22T14:31:27Z"
> lastUpdateTime: "2021-12-22T14:31:27Z"
> message: default/camel-k
> reason: IntegrationPlatformAvailable
> status: "True"
> type: IntegrationPlatformAvailable
>   - firstTruthyTime: "2021-12-22T14:31:27Z"
> lastTransitionTime: "2021-12-22T14:31:27Z"
> lastUpdateTime: "2021-12-22T14:31:27Z"
> message: kit-c710tlu2oq5s73f67ccg
> reason: IntegrationKitAvailable
> status: "True"
> type: IntegrationKitAvailable
>   - lastTransitionTime: "2021-12-22T14:31:27Z"
> lastUpdateTime: "2021-12-22T14:31:27Z"
> message: fallback strategy selected
> reason: CronJobNotAvailableReason
> status: "False"
> type: CronJobAvailable
>   - firstTruthyTime: "2021-12-22T14:31:27Z"
> lastTransitionTime: "2021-12-22T14:31:27Z"
> lastUpdateTime: "2021-12-22T14:31:27Z"
> message: deployment name is micro-profile-metrics2
> reason: DeploymentAvailable
> status: "True"
> type: DeploymentAvailable
>   - lastTransitionTime: "2021-12-22T14:31:27Z"
> lastUpdateTime: "2021-12-22T14:31:27Z"
> message: no http service required
> reason: ServiceNotAvailable
> status: "False"
> type: ServiceAvailable
>   - firstTruthyTime: "2021-12-22T14:31:27Z"
> lastTransitionTime: "2021-12-22T14:31:27Z"
> lastUpdateTime: "2021-12-22T14:31:27Z"
> message: PodMonitor (micro-profile-metrics2) -> integration(8080)
> reason: PrometheusAvailable
> status: "True"
> type: PrometheusAvailable
>   - lastTransitionTime: "2021-12-22T14:31:27Z"
> lastUpdateTime: "2021-12-22T14:31:27Z"
> message: no host or service defined
> reason: IngressNotAvailable
> status: "False"
> type: ExposureAvailable
>   - firstTruthyTime: "2021-12-22T14:31:28Z"
> lastTransitionTime: "2021-12-22T14:31:28Z"
> lastUpdateTime: "2021-12-22T14:31:28Z"
> message: 1/1 ready replicas
> reason: DeploymentReady
> status: "True"
> type: Ready
>   dependencies:
>   - camel:cron
>   - camel:microprofile-metrics
>   - camel:quartz
>   - mvn:org.apache.camel.k:camel-k-cron
>   - mvn:org.apache.camel.k:camel-k-runtime
>   - mvn:org.apache.camel.quarkus:camel-quarkus-java-joor-dsl
>   - mvn:org.apache.camel.quarkus:camel-quarkus-microprofile-metrics
>   digest: vqPpgTWXUuCKWFNdM39TznX4w1urMOF4PIhzrvSCe594
>   image:
> docker.io/betonetotbo/camel-k-kit-c710tlu2oq5s73f67ccg@sha256:a3fa2469bc9a5dbf8edfeb9dba693c9d43a6da2e75cf1046cd270833f84fe870
>   integrationKit:
> name: kit-c710tlu2oq5s73f67ccg
> namespace: default
>   lastInitTimestamp: "2021-12-22T14:31:27Z"
>   phase: Running
>   platform: camel-k
>   profile: Kubernetes
>   replicas: 1
>   runtimeProvider: quarkus
>   runtimeVersion: 1.10.0
>   selector: camel.apache.org/integration=micro-profile-metrics2
>   version: 1.7.0
>


Camel-K integration status phases

2022-01-21 Thread Roberto Camelk
What are the values of integration status phases?

In the API documentation this field is a "string", so anything is
possible ehehehe...

Here is an sample about the output of the "get integration" that am I
using to map this "status.phase" to a enumeration inside my
application:

kubectl get integration micro-profile-metrics2 -o yaml

apiVersion: camel.apache.org/v1
kind: Integration
metadata:
  creationTimestamp: "2021-12-22T14:31:27Z"
  generation: 1
  name: micro-profile-metrics2
  namespace: default
  resourceVersion: "361241"
  uid: 89de44cc-0b85-48ae-9198-b88287e89805
spec:
  dependencies:
  - camel:cron
  - camel:microprofile-metrics
  sources:
  - content: "//camel-k: dependency=camel-cron\n//camel-k:
dependency=camel-quarkus-microprofile-metrics\n\nimport
  org.apache.camel.builder.RouteBuilder;\n\npublic class
MicroProfileMetrics2
  extends RouteBuilder {\n\n@Override\npublic void
configure() throws
  Exception
{\n\tfrom(\"cron:tab?schedule=0/15+*+*+*+*+?\")\n\t\t.routeId(\"metrics\")\n\t\t.log(\"Starting
  MicroProfile
Metrics\")\n\t\t.delay(simple(\"${random(1000,5000)}\"))\n\t\t.choice()\n\t\t\t.when().simple(\"${random(1,10)}
  < 2\")\n\t\t\t\t.throwException(new
RuntimeException(\"Perdeu\"))\n\t\t\t.otherwise()\n\t\t\t\t.log(\"MicroProfile
  Metrics sample done!\");\n}\n\n}\n"
name: MicroProfileMetrics2.java
  traits:
logging:
  configuration:
level: TRACE
prometheus:
  configuration:
enabled: true
status:
  capabilities:
  - cron
  conditions:
  - firstTruthyTime: "2021-12-22T14:31:27Z"
lastTransitionTime: "2021-12-22T14:31:27Z"
lastUpdateTime: "2021-12-22T14:31:27Z"
message: default/camel-k
reason: IntegrationPlatformAvailable
status: "True"
type: IntegrationPlatformAvailable
  - firstTruthyTime: "2021-12-22T14:31:27Z"
lastTransitionTime: "2021-12-22T14:31:27Z"
lastUpdateTime: "2021-12-22T14:31:27Z"
message: kit-c710tlu2oq5s73f67ccg
reason: IntegrationKitAvailable
status: "True"
type: IntegrationKitAvailable
  - lastTransitionTime: "2021-12-22T14:31:27Z"
lastUpdateTime: "2021-12-22T14:31:27Z"
message: fallback strategy selected
reason: CronJobNotAvailableReason
status: "False"
type: CronJobAvailable
  - firstTruthyTime: "2021-12-22T14:31:27Z"
lastTransitionTime: "2021-12-22T14:31:27Z"
lastUpdateTime: "2021-12-22T14:31:27Z"
message: deployment name is micro-profile-metrics2
reason: DeploymentAvailable
status: "True"
type: DeploymentAvailable
  - lastTransitionTime: "2021-12-22T14:31:27Z"
lastUpdateTime: "2021-12-22T14:31:27Z"
message: no http service required
reason: ServiceNotAvailable
status: "False"
type: ServiceAvailable
  - firstTruthyTime: "2021-12-22T14:31:27Z"
lastTransitionTime: "2021-12-22T14:31:27Z"
lastUpdateTime: "2021-12-22T14:31:27Z"
message: PodMonitor (micro-profile-metrics2) -> integration(8080)
reason: PrometheusAvailable
status: "True"
type: PrometheusAvailable
  - lastTransitionTime: "2021-12-22T14:31:27Z"
lastUpdateTime: "2021-12-22T14:31:27Z"
message: no host or service defined
reason: IngressNotAvailable
status: "False"
type: ExposureAvailable
  - firstTruthyTime: "2021-12-22T14:31:28Z"
lastTransitionTime: "2021-12-22T14:31:28Z"
lastUpdateTime: "2021-12-22T14:31:28Z"
message: 1/1 ready replicas
reason: DeploymentReady
status: "True"
type: Ready
  dependencies:
  - camel:cron
  - camel:microprofile-metrics
  - camel:quartz
  - mvn:org.apache.camel.k:camel-k-cron
  - mvn:org.apache.camel.k:camel-k-runtime
  - mvn:org.apache.camel.quarkus:camel-quarkus-java-joor-dsl
  - mvn:org.apache.camel.quarkus:camel-quarkus-microprofile-metrics
  digest: vqPpgTWXUuCKWFNdM39TznX4w1urMOF4PIhzrvSCe594
  image: 
docker.io/betonetotbo/camel-k-kit-c710tlu2oq5s73f67ccg@sha256:a3fa2469bc9a5dbf8edfeb9dba693c9d43a6da2e75cf1046cd270833f84fe870
  integrationKit:
name: kit-c710tlu2oq5s73f67ccg
namespace: default
  lastInitTimestamp: "2021-12-22T14:31:27Z"
  phase: Running
  platform: camel-k
  profile: Kubernetes
  replicas: 1
  runtimeProvider: quarkus
  runtimeVersion: 1.10.0
  selector: camel.apache.org/integration=micro-profile-metrics2
  version: 1.7.0


Re: Re: Re: Square brackets in query param

2022-01-21 Thread Claus Ibsen
Hi

The fixes will be in 3.14.1 and 3.15.0.
Your 3.8.0 you can use the setHeader workaround I mentioned

On Fri, Jan 21, 2022 at 7:59 AM Yebba, Nicholas
 wrote:
>
> Thanks for the update.  Is this functionality available in my current version 
> 3.8.0 or do I have to upgrade ?  If I have to upgrade then which version from 
> maven repo should I use ?
>
> Thanks,
>
>
>
> On 2022/01/20 19:04:26 Claus Ibsen wrote:
> > Hi
> >
> > You can use a header with name CamelHttpQuery where you put the query 
> > parameters
> > and then call the http endpoint as a static name (without the query)
> > then the square brackets should work
> >
> >
> > On Thu, Jan 20, 2022 at 10:35 AM Pasquale Congiusti
> > mailto:pa...@gmail.com>> wrote:
> > >
> > > Yeah, it seems RAW() only works on the query parameter value.
> > > I've run some experiments and reported an issue here:
> > > https://issues.apache.org/jira/browse/CAMEL-17520
> > >  - likely it's a bug and
> > > we'll work on its resolution. Feel free to watch it on Jira or add any
> > > comments over there.
> > >
> > > Cheers,
> > > Pasquale.
> > >
> > > On Thu, Jan 20, 2022 at 8:57 AM Yebba, Nicholas
> > > mailto:ny...@massmutual.com.invalid>> wrote:
> > >
> > > > Thanks for the suggestion.  I tried using the RAW function but it seems 
> > > > as
> > > > though it’s not being interpreted.  For example when I inspect the URL
> > > > camel is sending the word RAW is contained in it.
> > > >
> > > >
> > > >
> > > > EX..
> > > > https://api.degreed.com/api/v2/content?RAW(filter[end_date])=2021-12-29(filter[start_date])=2021-12-29
> > > >  > > > https://api.degreed.com/api/v2/content?RAW(filter%5Bend_date%5D)=2021-12-29(filter%5Bstart_date%5D)=2021-12-29
> > > > >
> > > >
> > > >
> > > > .to("
> > > > https://api.degreed.com/api/v2/content?RAW(filter[end_date])=2021-12-29(filter[start_date])=2021-12-29
> > > > ")
> > > >
> > > >
> > > >
> > > > Is there an example of how to use this function in code ?  I also tried
> > > > using the $simple
> > > > https://camel.apache.org/components/3.14.x/languages/simple-language.html
> > > >
> > > > but couldn’t get it to interpret either.
> > > >
> > > >
> > > > On 2022/01/19 08:30:07 Pasquale Congiusti wrote:
> > > > > Hi Nick,
> > > > > maybe you can wrap them using RAW() function:
> > > > >
> > > > https://camel.apache.org/manual/faq/how-do-i-configure-endpoints.html#HowdoIconfigureendpoints-Configuringparametervaluesusingrawvalues
> > > > <
> > > >