Giter VIP home page Giter VIP logo

rabbit-amazon-bridge's People

Contributors

dcatanho-tyro avatar jcoleman-tyro avatar julientyro avatar maccac avatar martin-greber avatar mc-tyro avatar mselvaku avatar pauldthomson avatar pavan-tyro avatar rajeshgpai avatar rpai-tyro avatar singsurbhi avatar steveorourke avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

rabbit-amazon-bridge's Issues

Improve error logging

Recently we got a connection issue, but the logs are missing some key information that would help us debug what's going on. For example, this is what we got:
{"exception_class":"com.amazonaws.SdkClientException","exception_message":"Unable to execute HTTP request: Connect to **** [****/****] failed: Connection refused (Connection refused)","stacktrace":"com.amazonaws.http.AmazonHttpClient$RequestExecutor.handleRetryableException(AmazonHttpClient.java:1136), com.amazonaws.http.AmazonHttpClient$RequestExecutor.executeHelper(AmazonHttpClient.java:1082), com.amazonaws.http.AmazonHttpClient$RequestExecutor.doExecute(AmazonHttpClient.java:745), com.amazonaws.http.AmazonHttpClient$RequestExecutor.executeWithTimer(AmazonHttpClient.java:719), com.amazonaws.http.AmazonHttpClient$RequestExecutor.execute(AmazonHttpClient.java:701), com.amazonaws.http.AmazonHttpClient$RequestExecutor.access$500(AmazonHttpClient.java:669), com.amazonaws.http.AmazonHttpClient$RequestExecutionBuilderImpl.execute(AmazonHttpClient.java:651), com.amazonaws.http.AmazonHttpClient.execute(AmazonHttpClient.java:515), com.amazonaws.services.sqs.AmazonSQSClient.doInvoke(AmazonSQSClient.java:2147), com.amazonaws.services.sqs.AmazonSQSClient.invoke(AmazonSQSClient.java:2116), com.amazonaws.services.sqs.AmazonSQSClient.invoke(AmazonSQSClient.java:2105), com.amazonaws.services.sqs.AmazonSQSClient.executeReceiveMessage(AmazonSQSClient.java:1559), com.amazonaws.services.sqs.AmazonSQSAsyncClient$14.call(AmazonSQSAsyncClient.java:1057), com.amazonaws.services.sqs.AmazonSQSAsyncClient$14.call(AmazonSQSAsyncClient.java:1051), java.util.concurrent.FutureTask.run(FutureTask.java:266), java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149), java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624), java.lang.Thread.run(Thread.java:748)"}}

It would be useful to know what we were polling when the error happened

Test SQS Profile isn't being picked up

It appears that the @Profile settings for the AWSSqsConfig vs the AWSSqsTestConfig are clashing unless we provide both the test and docker-integration-test profiles when running the application.

We just need to use more sensible profile expressions to prevent them from clashing with each other.

I also noted that we're not annotating the sqs beans with a shutdown method like spring does in SqsClientConfiguration and we should try to be as similar as possible as we are rolling our own.

Make dead-lettering optional

In some environments the user may not wish to dead-letter on an error.
Provide options to drop the message, nack it so it gets replayed, or dead-letter it.
A question is should there be a default behaviour and what would it be?

Remove the requirement that all bridges need a transformation

We originally put this rule in place to force us to do a particular transformation on all bridges. This made sense for our use case in Tyro, but does not make sense for the base rabbit-amazon-bridge. We think this would make more sense for users to handle via a unit or integration test of their bridge config.

We think we should remove this behaviour for now.

Improve documentation

Lots of improvements can be made to the documentation:

  • How to run it
  • Diagrams
  • Links to jolt
  • Custom properties that we added
  • Useful Spring properties that can be used to customise it

Improve dead-letter handling

It would make sense to add alternatives to just deadlettering every message if Amazon is unavailable.

For this I would propose:

  • Catching all recoverable exceptions, e.g. AmazonClientException or HttpException
  • Allowing the setting of a TTL on deadletter queues or; Enable spring-retry by default, or and throwing the recoverable exceptions. Of just document the properties in the README
    spring.rabbitmq.listener.simple.retry.enabled=true spring.rabbitmq.listener.simple.retry.initial-interval=5000 spring.rabbitmq.listener.simple.retry.max-attempts=5 spring.rabbitmq.listener.simple.retry.multiplier=1.5 spring.rabbitmq.listener.simple.retry.max-interval=30000

Add support for a custom property file or remove it

We currently reference a private.properties file. This is something that we had to do for our application due our on-prem setup. If we can't change our on-prem setup and remove this property file we can look at making its path a configuration option.

Dockerify the build

We should ideally run the build in docker so that we are less dependent on the developers environment.

Simplify the build

The build process is a bit complicated and hard to understand.
We could simplify things by:

  • Build using maven, rather than maven in docker
  • Test and integration test using maven, rather than maven in docker-compose. We already spin up required containers using docker-maven-plugin

Remove gson from the project

We started using Gson when we started this project, then pulled in Jolt that uses Jackson under the hoods. We should just stick with Jackson. It is Springs default reducing configuration.

There is also a .jackson-kotlin-module that respects kotlins null safety during deserialisation which will eliminate some custom validation in our bridge file parser.

Default our logging to be json

We agreed that we prefer our logging to be structured as JSON so we will enable this by default.
This can of course be overridable using standard spring properties.

Move transformation from the rabbit from element to the top level

In order to provide for more flexibility for later changes and improve the base model.

e.g.

 "from" : {
      "rabbit": {
        "exchange": "exchange-name-1",
        "queueName": "queue-name-1",
        "routingKey": "routing-key-1"
      }
    },
    "transformationSpecs": {
       "type": "jolt",
       "transformations":  [{
         "operation": "shift",
         "spec": {
           "fieldA": "fieldA",
           "fieldB": "fieldB"
         }
     }]
    },
    "to" : {
      "sns": {
        "name":"rabbit-bridge-test-topic"
      }
    }
  }

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.