You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@camel.apache.org by Gaurav Verma <ga...@gmail.com> on 2021/12/29 12:00:09 UTC

Apache Camel - Jolt Remote Spec Issue

Hi Team,

I am trying to use a remote spec json file with jolt endpoint but shift
operation is not working as expected while it works fine if I use the same
spec file in my local.

Working code:

from(rabbitmqUri)
      .transform(body().convertTo(String.class))
      .to("jolt:/specs/securecx-to-pragma-spec.json?inputType=JsonString&outputType=JsonString")

Not Working Code:

from(rabbitmqUri)
      .transform(body().convertTo(String.class))
      .to("jolt:http://storage.googleapis.com/asia.artifacts.apigee-sample-2021.appspot.com/specs/securecxToPragmaSpec.json?inputType=JsonString&outputType=JsonString")

Input Json:
{
"ssoId": "bob@cnx.com",
"violationType": "phone",
"violationMessageTitle": "phone detected",
"violationMessageDesc": "phone detected at back"
}

Expected Json:

{
"ssoId" : "bob@cnx.com",
"messageDetails" : {
"title" : "phone detected",
"desc" : "phone detected at back"
}
}



Spec Used:

[
{
"operation": "shift",
"spec": {
"ssoId": "ssoId",
"violationMessageTitle": "messageDetails.title",
"violationMessageDesc": "messageDetails.desc"
}
}
]



Please help in identifying the cause and suggest the solution.
-- 
*Thanks & Regards,*
*Gaurav Verma*

Re: Apache Camel - Jolt Remote Spec Issue

Posted by Karen Lease <ka...@gmail.com>.
Hello Gaurav,

Maybe it's a silly question but are you sure the URL is accessible 
without providing some authentication? The one in the example below 
returns an access denied error if I put it in my browser.
What error are you getting in Camel? And please tell us which Camel 
version you're using.

Regards,
Karen

On 29/12/2021 13:00, Gaurav Verma wrote:
> Hi Team,
> 
> I am trying to use a remote spec json file with jolt endpoint but shift
> operation is not working as expected while it works fine if I use the same
> spec file in my local.
> 
> Working code:
> 
> from(rabbitmqUri)
>        .transform(body().convertTo(String.class))
>        .to("jolt:/specs/securecx-to-pragma-spec.json?inputType=JsonString&outputType=JsonString")
> 
> Not Working Code:
> 
> from(rabbitmqUri)
>        .transform(body().convertTo(String.class))
>        .to("jolt:http://storage.googleapis.com/asia.artifacts.apigee-sample-2021.appspot.com/specs/securecxToPragmaSpec.json?inputType=JsonString&outputType=JsonString")
> 
> Input Json:
> {
> "ssoId": "bob@cnx.com",
> "violationType": "phone",
> "violationMessageTitle": "phone detected",
> "violationMessageDesc": "phone detected at back"
> }
> 
> Expected Json:
> 
> {
> "ssoId" : "bob@cnx.com",
> "messageDetails" : {
> "title" : "phone detected",
> "desc" : "phone detected at back"
> }
> }
> 
> 
> 
> Spec Used:
> 
> [
> {
> "operation": "shift",
> "spec": {
> "ssoId": "ssoId",
> "violationMessageTitle": "messageDetails.title",
> "violationMessageDesc": "messageDetails.desc"
> }
> }
> ]
> 
> 
> 
> Please help in identifying the cause and suggest the solution.
>