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

Simplify input route implementation #15

Open
Tracked by #14
pjuza opened this issue Nov 15, 2014 · 3 comments
Open
Tracked by #14

Simplify input route implementation #15

pjuza opened this issue Nov 15, 2014 · 3 comments
Assignees
Milestone

Comments

@pjuza
Copy link
Member

pjuza commented Nov 15, 2014

Simplify and offer more productivity for often and common task when input route is implemented.

Focus on the most often use cases during input routes implementation:

  • direct/spring-ws URI
  • one route = one message
  • 0-N validators for input routes
  • optional: object ID, funnel value
  • garanteed order
  • throttling
@pjuza pjuza self-assigned this Nov 15, 2014
@pjuza pjuza added this to the CleverBus 1.2 milestone Nov 15, 2014
@pjuza
Copy link
Member Author

pjuza commented Nov 15, 2014

Try to use declarative approach with annotations:

@Async
public class CreateCustomerAccountRoute {

    public URI getOutURI() {
        return BillingAccountRoutes.URI_CREATE_CUSTOMER_ACCOUNT;
    }

   @Validator
   public Processor validateMandatoryFields() {
   }
}
@Async(operationName="CreateSazkaCustomer", guaranteedOrder=true)
public class CreateCustomerAccountRoute {

    @OutUri
    public String getOutURI() {
        return BillingAccountRoutes.URI_CREATE_CUSTOMER_ACCOUNT;
    }

    @Validator
    public Processor validateMandatoryFields() {
    }

    @FunnelValue
    public Expression getFunnelExpression() {
    }   

    @ObjectId
    public Expression getFunnelExpression() {
    }       
}

Main prerequisites:

  • support most often scenarious, not all cases. (analogy to Spring Security configuration)
  • use convention-over-configuration principle

Benefits:

  • focus on implementing important parts of integration, not needed to solve boiler-code
  • less error-prone
  • support for unit tests
  • not tighly dependant to specific protocol/service (JMS, WS, HTTP)

@pjuza
Copy link
Member Author

pjuza commented Nov 15, 2014

Spring has support for reading metadat about classes and annotations:

org.springframework.core.type.classreading.SimpleMetadataReaderFactory -> org.springframework.core.type.classreading.MetadataReader
org.springframework.context.annotation.ConfigurationClassUtils#isLiteConfigurationCandidate
org.springframework.beans.factory.config.BeanFactoryPostProcessor - cteni route bean
org.springframework.beans.factory.BeanClassLoaderAware

@pjuza
Copy link
Member Author

pjuza commented Nov 15, 2014

Original issues: CLVBUS-160

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

No branches or pull requests

2 participants