Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add support for expressions in endpoint definition attributes. #2238

Open
wants to merge 20 commits into
base: master
Choose a base branch
from

Conversation

chathuranga-jayanath-99

Purpose

Consider the following HTTP endpoint definition. To handle this definition, expression support is required for endpoint attributes. Currently, only timeout-duration supports expressions, but the need for expression support in other attributes has occurred during the implementation of the HTTP connector.

<http method="get" uri-template="{uri.var.base}{+uri.var.path}{+uri.var.query}">
  <timeout>
      <duration>{get-property('timeoutDuration')}</duration>
      <responseAction>{get-property('timeoutAction')}</responseAction>
  </timeout>
  <suspendOnFailure>
      <errorCodes>{get-property('suspendErrorCodes')}</errorCodes>
      <initialDuration>{get-property('suspendInitialDuration')}</initialDuration>
      <maximumDuration>{get-property('suspendMaximumDuration')}</maximumDuration>
      <progressionFactor>{get-property('suspendProgressionFactor')}</progressionFactor>
  </suspendOnFailure>
  <markForSuspension>
      <errorCodes>{get-property('retryErrorCodes')}</errorCodes>
      <retriesBeforeSuspension>{get-property('retryCount')}</retriesBeforeSuspension>
      <retryDelay>{get-property('retryDelay')}</retryDelay>
  </markForSuspension>
</http>

@GDLMadushanka
Copy link
Contributor

Please squash these commits to a single one

d = d.trim().substring(1, d.length() - 1);
SynapseXPath xpath = new SynapseXPath(d);
definition.setDynamicTimeoutExpression(xpath);
if (isExpression(d)) {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Do we need this check? The ValueFactory will check wether it's an expression or not and resolve the value.

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Updated using ValueFactory.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants