Petals SE Camel

Add support of placeholders to configure Java routes

Details

  • Type: Improvement Request Improvement Request
  • Status: Resolved Resolved
  • Priority: Major Major
  • Resolution: Fixed
  • Affects Version/s: 1.0.2
  • Fix Version/s: 1.1.0
  • Component/s: None
  • Security Level: Public
  • Description:
    Hide

    Add support of placeholders configured at component level to configure the Java routes.

    If the placeholder 'my-placeholder' is defined, it could be used as following in the Java route:

    fromPetals(OBTENIR_SIGNATAIRE).process(new Step("Prepare obtention du signataire du bordereau") {
        @Override
        public void process(final Exchange exchange) throws Exception {
            final ObtenirSignataire body = marshalling.unmarshal(exchange.getIn(), ObtenirSignataire.class);
            ...
            final String myPlaceholder = this.getPlaceHolder("my-placeholder");
            ...
            marshalling.marshal(exchange.getOut(), request);
        }
    }).to(...)

    And if placeholders are reloaded, the route definition based on 'PetalsRouteBuilder' will be notified through the method 'onPlaceHolderValuesReloaded':

    @Override
    public void onPlaceHolderValuesReloaded(final Properties newPlaceholders) {
        super.onPlaceHolderValuesReloaded(newPlaceholders);
        try {
            this.reloadFiles();
        } catch (final IOException e) {
            log.warn("An error occurs !.", e);
        }
    }
    Show
    Add support of placeholders configured at component level to configure the Java routes. If the placeholder 'my-placeholder' is defined, it could be used as following in the Java route:
    fromPetals(OBTENIR_SIGNATAIRE).process(new Step("Prepare obtention du signataire du bordereau") {
        @Override
        public void process(final Exchange exchange) throws Exception {
            final ObtenirSignataire body = marshalling.unmarshal(exchange.getIn(), ObtenirSignataire.class);
            ...
            final String myPlaceholder = this.getPlaceHolder("my-placeholder");
            ...
            marshalling.marshal(exchange.getOut(), request);
        }
    }).to(...)
    And if placeholders are reloaded, the route definition based on 'PetalsRouteBuilder' will be notified through the method 'onPlaceHolderValuesReloaded':
    @Override
    public void onPlaceHolderValuesReloaded(final Properties newPlaceholders) {
        super.onPlaceHolderValuesReloaded(newPlaceholders);
        try {
            this.reloadFiles();
        } catch (final IOException e) {
            log.warn("An error occurs !.", e);
        }
    }
  • Environment:
    -

Activity

Christophe DENEUX made changes - Wed, 18 Oct 2017 - 10:24:28 +0200
Field Original Value New Value
Assignee Victor NOËL [ vnoel ] Christophe DENEUX [ cdeneux ]
Priority Major [ 3 ]
Description Add support of placeholders configured at component level to configure the Java routes.

If the placeholder '{{my-placeholder}}' is defined, it could be used as following in the Java route:
{code:java}
fromPetals(OBTENIR_SIGNATAIRE).process(new Step("Prepare obtention du signataire du bordereau") {
    @Override
    public void process(final Exchange exchange) throws Exception {
        final ObtenirSignataire body = marshalling.unmarshal(exchange.getIn(), ObtenirSignataire.class);
        ...
        final String myPlaceholder = this.getPlaceHolder("my-placeholder");
        ...
        marshalling.marshal(exchange.getOut(), request);
    }
}).to(...)
{code}

And if placeholders are reloaded, the route definition based on '{{PetalsRouteBuilder}}' will be notified through the method '{{onPlaceHolderValuesReloaded}}'.
Add support of placeholders configured at component level to configure the Java routes.

If the placeholder '{{my-placeholder}}' is defined, it could be used as following in the Java route:
{code:java}
fromPetals(OBTENIR_SIGNATAIRE).process(new Step("Prepare obtention du signataire du bordereau") {
    @Override
    public void process(final Exchange exchange) throws Exception {
        final ObtenirSignataire body = marshalling.unmarshal(exchange.getIn(), ObtenirSignataire.class);
        ...
        final String myPlaceholder = this.getPlaceHolder("my-placeholder");
        ...
        marshalling.marshal(exchange.getOut(), request);
    }
}).to(...)
{code}

And if placeholders are reloaded, the route definition based on '{{PetalsRouteBuilder}}' will be notified through the method '{{onPlaceHolderValuesReloaded}}':
{code:java}
@Override
public void onPlaceHolderValuesReloaded(final Properties newPlaceholders) {
    super.onPlaceHolderValuesReloaded(newPlaceholders);
    try {
        this.reloadFiles();
    } catch (final IOException e) {
        log.warn("An error occurs !.", e);
    }
}
{code}
Christophe DENEUX made changes - Wed, 18 Oct 2017 - 10:24:33 +0200
Status New [ 10000 ] Open [ 10002 ]
Christophe DENEUX made changes - Wed, 18 Oct 2017 - 10:24:37 +0200
Status Open [ 10002 ] In Progress [ 10003 ]
Hide
Christophe DENEUX added a comment - Thu, 19 Oct 2017 - 17:46:19 +0200

Support of placeholders added

Show
Christophe DENEUX added a comment - Thu, 19 Oct 2017 - 17:46:19 +0200 Support of placeholders added
Christophe DENEUX made changes - Thu, 19 Oct 2017 - 17:46:19 +0200
Status In Progress [ 10003 ] Resolved [ 10004 ]
Fix Version/s 1.1.0 [ 10750 ]
Resolution Fixed [ 1 ]
Transition Status Change Time Execution Times Last Executer Last Execution Date
New New Open Open
1m 38s
1
Christophe DENEUX
Wed, 18 Oct 2017 - 10:24:33 +0200
Open Open In Progress In Progress
4s
1
Christophe DENEUX
Wed, 18 Oct 2017 - 10:24:37 +0200
In Progress In Progress Resolved Resolved
1d 7h 21m
1
Christophe DENEUX
Thu, 19 Oct 2017 - 17:46:19 +0200

People

Dates

  • Created:
    Wed, 18 Oct 2017 - 10:22:55 +0200
    Updated:
    Thu, 19 Oct 2017 - 17:46:19 +0200
    Resolved:
    Thu, 19 Oct 2017 - 17:46:19 +0200