Microservice framework following best cloud practices with a focus on productivity.

Overview

patron CI codecov Go Report Card GoDoc GitHub release

Patron is a framework for creating microservices, originally created by Sotiris Mantzaris (https://github.com/mantzas). This fork is maintained by Beat Engineering (https://thebeat.co)

Patron is french for template or pattern, but it means also boss which we found out later (no pun intended).

The entry point of the framework is the Service. The Service uses Components to handle the processing of sync and async requests. The Service starts by default an HTTP Component which hosts the debug, alive, ready and metric endpoints. Any other endpoints will be added to the default HTTP Component as Routes. Alongside Routes one can specify middleware functions to be applied ordered to all routes as MiddlewareFunc. The service set's up by default logging with zerolog, tracing and metrics with jaeger and prometheus.

Patron provides abstractions for the following functionality of the framework:

  • service, which orchestrates everything
  • components and processors, which provide an abstraction of adding processing functionality to the service
    • asynchronous message processing (RabbitMQ, Kafka, AWS SQS)
    • synchronous processing (HTTP)
    • gRPC support
  • metrics and tracing
  • logging

Patron provides the same defaults for making the usage as simple as possible. Patron needs Go 1.14 as a minimum.

Table of Contents

Comments
  • [WIP] Add integration tests for async/amqp, trace/amqp

    [WIP] Add integration tests for async/amqp, trace/amqp

    Which problem is this PR solving?

    This PR closes #171 Add integration tests for async/amqp.

    Short description of the changes

    • Modify Github Actions definition so that it starts the rabbitmq container and network.
    • Add integration tests for the async/amqp package.
    • Add integration tests for the trace/amqp package.

    Notes

    • I'm using different queues for each package, as I came across messages from one package 'leaking' into another package's tests.

    • I will have to run some commits so I can live-debug Github Actions, hope it's okay.

    As we mentioned, we need to avoid flakiness. The tests seem to work without flakiness both locally and on Github Actions.

    $ for i in {1..50}; do
    go test -timeout 30s github.com/beatlabs/patron/async/amqp -run "^(TestConsumeAndDeliver)$" -count=1
    done | grep "^ok" | wc -l
        50 
    
    $ for i in {1..20}; do go test ./component/async/amqp -tags=integration -count=1; done | grep ^ok | wc -l
          20
    $ for i in {1..20}; do go test ./client/amqp -tags=integration -count=1; done | grep ^ok | wc -l
          20
    
    
    opened by tpaschalis 17
  • Kafka: add support for active brokers in Producers

    Kafka: add support for active brokers in Producers

    Is your feature request related to a problem? Please describe

    It is necessary to check the healthiness of Kafka consumers/producers; in https://github.com/Shopify/sarama/issues/1341 it is mentioned that this could be done by checking that there are active brokers (they are checked periodically by the client anyways).

    Describe the solution

    The minimally invasive solution is to use https://godoc.org/github.com/Shopify/sarama#NewAsyncProducerFromClient in Patron and then expose the Brokers() method.

    ~This solution should work for both consumers and producers if we expose functionality of the Client.~ We will focus on the producers only.

    Additional context

    This is related to #148, in the sense that more functionality of the Kafka client library is necessary.

    enhancement 
    opened by gm42 16
  • It's not possible to change deflate compression level

    It's not possible to change deflate compression level

    Is your feature request related to a problem? Please describe

    I want to have the possibility to override a default deflate level. It's hardcoded to 8 (deflateLevel = 8) in HTTP component builder. I want to be able to choose this value as it impacts the performance of my service and the size of a payload.

    Is this a bug? Please provide steps to reproduce, a failing test etc.

    It's not a bug

    Describe the solution

    I want to expose it using the env var in service.go::createHTTPComponent(), the same way as port and timeouts are exposed. The builder method is already there. b.WithDeflateLevel()

    Additional context

    I believe that it's just a good practice for a framework to have as little opinionated hardcoded values as possible. Everything or almost everything should be configurable in a good framework if we want other people to use it.

    opened by azarakovskiy 15
  • Proposal: Add

    Proposal: Add "path" tag for decoding URN parameters into struct fields.

    Hi there,

    Is your feature request related to a problem? Please describe

    Let’s assume we have an endpoint: UPDATE /v1/user/:id with body {"name": string, "age": int}

    Usually there is a struct that represents this request that looks like

    type UpdateUserRequest struct {
    	ID   int
    	Name string `json:"name"`
    	Age  int    `json:"age"`
    }
    

    Handlers usually do this:

    func (r *Router) updateUser(ctx context.Context, req *http.Request) (*http.Response, error) {
            var r UpdateUserRequest
            if err := req.Decode(&r); err != nil {
                return nil, errors.New("failed to decode request")
            }
    
            // check if the param is there 
            s, ok := req.Fields["id"]
    		if !ok {
    			return nil, errors.New("id is not found")
    		}
    		id, err := strconv.Atoi(s)
    		if err != nil {
    			return nil, errors.New("id is not an integer")
    		}
    
            // assigning ID to the struct
            r.ID = id
    
            // validating
            if err := r.Validate(); err != nil {
               return nil, err
            }
    
            // finally at this point it's possible to use the structure
    }
    

    In case of a request without the body ( e.g.,GET /v1/user/:id ) using req.Fields["id"] is more or less bearable.

    But in the case when a request has the body in JSON like in the example - it’s getting inconvenient ( another case when endpoint looks like POST /v1/user/:group_id/:id ).

    The actual implementation depends from case to case but what’s in common is a pretty boilerplate part of converting string representation into integers + merging with “request” struct

    Describe the solution

    I’d like to propose is using tags. Imagine that we have this struct

    type UpdateUserRequest struct {
    	ID   int    `path:"id"` <<<<-- here's a hint for Patron to map `:id` from URN onto this field
    	Name string `json:"name"`
    	Age  int    `json:"age"`
    }
    

    In this case a handler could look like

    func (r *Router) updateUser(ctx context.Context, req *http.Request) (*http.Response, error) {
            var r UpdateUserRequest
            if err := req.Decode(&r); err != nil {
                return nil, errors.New("failed to decode request")
            }
    
            // validating
            if err := r.Validate(); err != nil {
               return nil, err
            }
    
            // finally at this point it's possible to use structure
    }
    

    What do you think about this proposal?

    Thank you.

    enhancement 
    opened by superstas 14
  • #277 - Fix port conflict for sixth and seventh examples

    #277 - Fix port conflict for sixth and seventh examples

    Signed-off-by: santosh [email protected]

    Which problem is this PR solving?

    Resolves #277

    Short description of the changes

    Change port for seventh example to 50007 to avoid conflict with sixth example. Also change the port in DoTimingRequest function of 1st example which uses service exposed by 7th example.

    opened by bhiravabhatla 13
  • feat: Kafka Consumer Package

    feat: Kafka Consumer Package

    Which problem is this PR solving?

    Closes #260

    Short description of the changes

    We've had a few discussions about the best way to move forward with the task; the key outcomes were

    • Kafka's streaming logic is different than the message broker logic of AMQP and SNS/SQS. Trying to contain both under a single abstraction is not ideal.
    • Instead of maintaining the current abstraction, we've decided to introduce a new Kafka package with support for batching and
    • This new package is more transparent in regards to Sarama; exposing more its internals, plus with QoL helpers for the end-users.

    Checklist

    • [x] Component
    • [x] Retries
    • [x] Batching
    • [x] Raw Sarama Message
    • [x] Raw Sarama Config
    • [x] Update Sarama
    • [x] Failure strategy
    • [x] Metrics
    • [x] Tracing
    • [x] Unit tests
    • [x] Integration tests
    opened by oss92 12
  • Prometheus Exemplars Support

    Prometheus Exemplars Support

    Which problem is this PR solving?

    Enabling Prometheus Exemplars. This PR is a copy of the POC made by @ioannissavvaidis.

    Short description of the changes

    • Added support for Prometheus Exemplars

    • Updated Observarbility.md documentation

    • Enabled Prometheus Exemplars for request latency and counter metric in

      • ../client/http/http.go
      • ../client/amqp/v2/amqp.go
      • ../client/es/elasticsearch.go
      • ../client/grpc/grpc.go
      • ../client/redis/redis.go
      • ../client/sns/v2/publisher.go
      • ../client/sql/publisher.go
      • ../client/sns/v2/publisher.go
      • ../component/amqp
      • ../component/grpc
      • ../component/kafka
      • ..component/http/middleware
      • ../component/sqs
      • ../client/kafka/v2
    • Fixed a way how we record "success" metric. Mark metric entry as "success" if err == nil before we marked it as success if err != nil

    opened by EvgeniaMartynova-thebeat 11
  • Documentation, Comments and renaming some variables and functions (fixes #385)

    Documentation, Comments and renaming some variables and functions (fixes #385)

    Signed-off-by: Rodrigo Broggi [email protected]

    Which problem is this PR solving?

    This PR aims on enriching the whole experience of using the (amazing) examples folder. During it's development some small bugs were identified and therefore I tried to solve them as well within the scope of the PR.

    You can find more detailed comments across the changed files.

    1. Documentation enhancement with creation of diagrams and new notes in the Examples.md file Issue 385.
    2. Creation of a wrapper script called services.sh in the examples folder that helps with startup/stop of the services in the examples folder
    3. Attempt to correct two bugs that were affecting the correct functioning of the examples integration suite:
      1. panic in amqp/main.go ( bug in the actual prd code. issue 387)
      2. error in decoding in sqs/main.go#117

    Short description of the changes

    1. Documentation enhancements
    2. Minor nil pointer defensive programming
    3. update of the examples integration suite that was not working
    opened by rbroggi 11
  • Add metrics to zerolog and std logger

    Add metrics to zerolog and std logger

    Which problem is this PR solving?

    Resolves #513

    Short description of the changes

    Add a prometheus counter to the zerolog and std log package functions and unit test to see if the counter is incremented.

    opened by iNDicat0r 10
  • Feature: new HTTP server metrics with full status code

    Feature: new HTTP server metrics with full status code

    Which problem is this PR solving?

    Mainly:

    • Prometheus metrics to have the full HTTP status code

    We currently use Jaeger metrics which only sport 5xx, 2xx and the like; having the full status code in metrics is necessary for tailoring alerts and making more specific Grafana panels.

    This PR models the new metrics around the existing server-side gRPC metrics.

    Secondarily:

    • allowing to disable Jaeger/OpenTracing metrics (NOTE: this also means that the failures at parsing JAEGER_* environment variables now would happen when Run() is called instead of the constructor)
    • do not cache only the last Write in the response writer middleware, but all writes
    • do not cache written response if unnecessary for error logging purposes

    Short description of the changes

    We currently have:

    1. {microservice_name}_http_requests_total, {microservice_name}_http_requests_latency - these are provided by the Jaeger package and have labels endpoint="GET-/hello/world" and status_code="2xx"
    2. component_grpc_handled_total and component_grpc_handled_seconds with labels grpc_code="OK", grpc_method="CreateMyEvent", grpc_service="myservice.Service", grpc_type="unary"

    With this PR we would have:

    1. same as (1) before, but can be disabled by using WithoutJaeger() option
    2. same as (2) before
    3. component_http_handled_total and component_http_handled_seconds with labels status_code="200", method="GET", path="/hello/world", which follows the style of (2)
    opened by gmaz42 10
  • Errors with structured logging fields

    Errors with structured logging fields

    Is your feature request related to a problem? Please describe

    In the case where errors are returned to patron and patron logs them it would be really useful if there was a way to pass fields for the purpose of structured logging.

    Is this a bug? Please provide steps to reproduce, a failing test etc.

    Not a bug.

    Describe the solution

    An errors.WithFields interface could be used to see if there are any additional fields available to log.

    Additional context

    I've got a POC PR to illustrate the concept, the objective of the PR is to give context for discussions whether this is a good idea or not.

    opened by j0hnsmith 10
  • Bump github.com/stretchr/testify from 1.8.0 to 1.8.1

    Bump github.com/stretchr/testify from 1.8.0 to 1.8.1

    Bumps github.com/stretchr/testify from 1.8.0 to 1.8.1.

    Commits

    Dependabot compatibility score

    Dependabot will resolve any conflicts with this PR as long as you don't alter it yourself. You can also trigger a rebase manually by commenting @dependabot rebase.


    Dependabot commands and options

    You can trigger Dependabot actions by commenting on this PR:

    • @dependabot rebase will rebase this PR
    • @dependabot recreate will recreate this PR, overwriting any edits that have been made to it
    • @dependabot merge will merge this PR after your CI passes on it
    • @dependabot squash and merge will squash and merge this PR after your CI passes on it
    • @dependabot cancel merge will cancel a previously requested merge and block automerging
    • @dependabot reopen will reopen this PR if it is closed
    • @dependabot close will close this PR and stop Dependabot recreating it. You can achieve the same result by closing it manually
    • @dependabot ignore this major version will close this PR and stop Dependabot creating any more for this major version (unless you reopen the PR or upgrade to it yourself)
    • @dependabot ignore this minor version will close this PR and stop Dependabot creating any more for this minor version (unless you reopen the PR or upgrade to it yourself)
    • @dependabot ignore this dependency will close this PR and stop Dependabot creating any more for this dependency (unless you reopen the PR or upgrade to it yourself)
    dependencies go 
    opened by dependabot[bot] 0
  • Use docker-compose healthchecks

    Use docker-compose healthchecks

    Is your feature request related to a problem? Please describe

    In order to have our docker-compose files return only when all things have started, it would be nice to introduce healthchecks. This way starting up the environment will return only if all containers have started succesfully.

    Describe the solution

    Introduce healthchecks in our docker-compose files and remove any sleeps that have been introduced.

    enhancement 
    opened by mantzas 0
  • Patron service set up is broken

    Patron service set up is broken

    Is your feature request related to a problem? Please describe

    With the removal of the builder pattern, the setup of Patron has become a one-liner with the New() function. Previously though, by using the builder, we created a builder first which set up everything and then we created the service and ran it.

    The result is that logging and tracing are not set up correctly and the whole main function in the service is using the default logger.

    Is this a bug? Please provide steps to reproduce, a failing test etc.

    Just by creating a service, the problem is apparent.

    Describe the solution

    We need to re-introduce the two-step approach of setting things up first and then starting the service. We might even think about introducing the builder again.

    Another option, in order to avoid a builder pattern, is to keep the New() function which sets up a service and provides the components to run in the Run() method the functional options. This would give us the flexibility of the functional option pattern without the extra builder struct.

    bug 
    opened by mantzas 0
  • Add Deterministic ReadyCheck implementation

    Add Deterministic ReadyCheck implementation

    Is your feature request related to a problem? Please describe

    In kafka component we have a feature which provides info when a consumer is reached current offset (it closes a channel)

    simple.WithDurationOffset(since time.Duration)
    simple.WithNotificationOnceReachingLatestOffset(ch chan<- struct{})
    

    This is usually used in a readiness check to wait until consumer is ready and then a service is ready to process incoming requests. Readiness check is a simple function interface

    // ReadyCheckFunc defines a function type for implementing a readiness check.
    type ReadyCheckFunc func() ReadyStatus
    

    Currently, every time when one wants to use this feature they have to implement boilerplate readiness check.

    Describe the solution

    1. Add new package patron/probe independent from HTTP. It can be used then in gRPC probes.
    2. Extract probes related code into this new package in patron/probe/probe.go
    3. Add deterministic readiness check implementation in this new package in patron/probe/deterministic.go.

    Additional context

    New package with 2 files

    patron/probe
    -- probe.go
    -- deterministic.go
    

    Move probe related code into probe/probe.go file from component/http/v2/check.go. Leave code related to http routes there.

    package probe
    
    // AliveStatus type representing the liveness of the service.
    type AliveStatus int
    
    // ReadyStatus type.
    type ReadyStatus int
    
    const (
    	// Alive represents a state defining an Alive state.
    	Alive AliveStatus = 1
    	// Unhealthy represents an unhealthy alive state.
    	Unhealthy AliveStatus = 2
    
    	// Ready represents a state defining a Ready state.
    	Ready ReadyStatus = 1
    	// NotReady represents a state defining a NotReady state.
    	NotReady ReadyStatus = 2
    
    	// AlivePath of the component.
    	AlivePath = "/alive"
    	// ReadyPath of the component.
    	ReadyPath = "/ready"
    )
    
    // ReadyCheckFunc defines a function type for implementing a readiness check.
    type ReadyCheckFunc func() ReadyStatus
    
    // LivenessCheckFunc defines a function type for implementing a liveness check.
    type LivenessCheckFunc func() AliveStatus
    

    Add another file probe/deterministic.go with the following deterministic ready check implementation.

    package probe
    
    import (
    	"sync"
    	"time"
    
    	"github.com/beatlabs/patron/log"
    )
    
    // DeterministicReadyCheck waits until all the defined channels are closed
    type DeterministicReadyCheck struct {
    	sync.Mutex
    	checks map[string]*readyCheck
    	status v2.ReadyStatus
    }
    
    // NewDeterministicReadyCheck creates new deterministic check
    func NewDeterministicReadyCheck() *DeterministicReadyCheck {
    	return &DeterministicReadyCheck{
    		checks: make(map[string]*readyCheck),
    		status: v2.NotReady,
    	}
    }
    
    // AddCheck add new channel to watch when it's closed
    func (r *DeterministicReadyCheck) AddCheck(name string, ch chan struct{}) *DeterministicReadyCheck {
    	r.checks[name] = &readyCheck{name: name, ch: ch, startedAt: time.Now()}
    	return r
    }
    
    // Status ask when all the checks are ready
    func (r *DeterministicReadyCheck) Status() v2.ReadyStatus {
    	r.Lock()
    	defer r.Unlock()
    
    	if r.status == v2.NotReady {
    		for _, chk := range r.checks {
    			if !chk.isReady() {
    				return r.status
    			}
    		}
    		r.status = v2.Ready
    	}
    
    	return r.status
    }
    
    type readyCheck struct {
    	name      string
    	ch        <-chan struct{}
    	startedAt time.Time
    	closed    bool
    }
    
    func (r *readyCheck) isReady() bool {
    	if r.closed {
    		return true
    	}
    	// if channel was closed, set the flag and log how long it took
    	select {
    	case _, ok := <-r.ch:
    		if !ok {
    			r.closed = true
    			log.Infof("readiness %s: %v", r.name, time.Since(r.startedAt))
    			return true
    		}
    	default:
    	}
    	return false
    }
    
    opened by koschos 0
Releases(v0.73.2)
  • v0.73.2(Oct 14, 2022)

    What's Changed

    • Add newlines with default logger by @mantzas in https://github.com/beatlabs/patron/pull/580

    Full Changelog: https://github.com/beatlabs/patron/compare/v0.73.1...v0.73.2

    Source code(tar.gz)
    Source code(zip)
  • v0.73.1(Oct 14, 2022)

    What's Changed

    • Default Kafka consumer version by @mantzas in https://github.com/beatlabs/patron/pull/572
    • Introduce CI matrix tests for supported Go versions by @xenosdio in https://github.com/beatlabs/patron/pull/575
    • Go 1.17 upgrade by @mantzas in https://github.com/beatlabs/patron/pull/577
    • Bump github.com/aws/aws-sdk-go-v2/service/sqs from 1.19.9 to 1.19.10 by @dependabot in https://github.com/beatlabs/patron/pull/578
    • Upgrade packages by @mantzas in https://github.com/beatlabs/patron/pull/579

    Full Changelog: https://github.com/beatlabs/patron/compare/v0.73.0...v0.73.1

    Source code(tar.gz)
    Source code(zip)
  • v0.73.0(Sep 29, 2022)

    What's Changed

    • Fix log tests by @mantzas in https://github.com/beatlabs/patron/pull/553
    • Error package documentation by @mantzas in https://github.com/beatlabs/patron/pull/570
    • [Breaking Change] Migrate to AWS SDK v2 by @xenosdio in https://github.com/beatlabs/patron/pull/551

    New Contributors

    • @xenosdio made their first contribution in https://github.com/beatlabs/patron/pull/551

    Full Changelog: https://github.com/beatlabs/patron/compare/v0.72.2...v0.73.0

    Source code(tar.gz)
    Source code(zip)
  • v0.72.2(Sep 22, 2022)

    What's Changed

    • Bump github.com/rs/zerolog from 1.27.0 to 1.28.0 by @dependabot in https://github.com/beatlabs/patron/pull/548
    • Removing accept type from JSON client helper function by @mantzas in https://github.com/beatlabs/patron/pull/547
    • Feature: Add logfmt support to std logger by @Oberonus in https://github.com/beatlabs/patron/pull/550

    Full Changelog: https://github.com/beatlabs/patron/compare/v0.72.1...v0.72.2

    Source code(tar.gz)
    Source code(zip)
  • v0.72.1(Sep 16, 2022)

    What's Changed

    • Removing content length from JSON helper by @mantzas in https://github.com/beatlabs/patron/pull/546

    Full Changelog: https://github.com/beatlabs/patron/compare/v0.72.0...v0.72.1

    Source code(tar.gz)
    Source code(zip)
  • v0.72.0(Sep 16, 2022)

    What's Changed

    • Bump github.com/rs/zerolog from 1.26.1 to 1.27.0 by @dependabot in https://github.com/beatlabs/patron/pull/521
    • Bump go.mongodb.org/mongo-driver from 1.8.4 to 1.9.1 by @dependabot in https://github.com/beatlabs/patron/pull/522
    • Bump github.com/elastic/go-elasticsearch/v8 from 8.2.0 to 8.3.0 by @dependabot in https://github.com/beatlabs/patron/pull/523
    • Bump github.com/stretchr/testify from 1.7.1 to 1.8.0 by @dependabot in https://github.com/beatlabs/patron/pull/524
    • Bump go.mongodb.org/mongo-driver from 1.9.1 to 1.10.0 by @dependabot in https://github.com/beatlabs/patron/pull/525
    • Bump github.com/Shopify/sarama from 1.34.1 to 1.35.0 by @dependabot in https://github.com/beatlabs/patron/pull/526
    • Bump google.golang.org/protobuf from 1.28.0 to 1.28.1 by @dependabot in https://github.com/beatlabs/patron/pull/527
    • Bump google.golang.org/grpc from 1.47.0 to 1.48.0 by @dependabot in https://github.com/beatlabs/patron/pull/528
    • Bump github.com/Shopify/sarama from 1.35.0 to 1.36.0 by @dependabot in https://github.com/beatlabs/patron/pull/535
    • HTTP app name and version header by @mantzas in https://github.com/beatlabs/patron/pull/533
    • Bump go.mongodb.org/mongo-driver from 1.10.0 to 1.10.1 by @dependabot in https://github.com/beatlabs/patron/pull/539
    • Bump google.golang.org/grpc from 1.48.0 to 1.49.0 by @dependabot in https://github.com/beatlabs/patron/pull/540
    • gRPC reflection support by @mantzas in https://github.com/beatlabs/patron/pull/541
    • Bump go.mongodb.org/mongo-driver from 1.10.1 to 1.10.2 by @dependabot in https://github.com/beatlabs/patron/pull/543
    • HTTP v2 JSON helper functions by @mantzas in https://github.com/beatlabs/patron/pull/537

    Full Changelog: https://github.com/beatlabs/patron/compare/v0.71.0...v0.72.0

    Source code(tar.gz)
    Source code(zip)
  • v0.71.0(Jun 17, 2022)

    What's Changed

    • Remove path from HTTP Client span names by @siavashs in https://github.com/beatlabs/patron/pull/516
    • Bump google.golang.org/grpc from 1.46.0 to 1.47.0 by @dependabot in https://github.com/beatlabs/patron/pull/512
    • MQTT Publisher by @mantzas in https://github.com/beatlabs/patron/pull/501
    • Add AWS Queue Owner ID by @erifili117 in https://github.com/beatlabs/patron/pull/520
    • Bump github.com/Shopify/sarama from 1.33.0 to 1.34.1 by @dependabot in https://github.com/beatlabs/patron/pull/519
    • Add metrics to zerolog and std logger by @iNDicat0r in https://github.com/beatlabs/patron/pull/517

    New Contributors

    • @erifili117 made their first contribution in https://github.com/beatlabs/patron/pull/520

    Full Changelog: https://github.com/beatlabs/patron/compare/v0.70.0...v0.71.0

    Source code(tar.gz)
    Source code(zip)
  • v0.70.0(Jun 7, 2022)

    What's Changed

    • Implement log level counter metrics by @iNDicat0r in https://github.com/beatlabs/patron/pull/514

    New Contributors

    • @iNDicat0r made their first contribution in https://github.com/beatlabs/patron/pull/514

    Full Changelog: https://github.com/beatlabs/patron/compare/v0.69.2...v0.70.0

    Source code(tar.gz)
    Source code(zip)
  • v0.69.2(May 31, 2022)

    What's Changed

    • MongoDB Client Metrics Success Label Fix by @gkech in https://github.com/beatlabs/patron/pull/510

    Full Changelog: https://github.com/beatlabs/patron/compare/v0.69.1...v0.69.2

    Source code(tar.gz)
    Source code(zip)
  • v0.69.1(May 24, 2022)

    What's Changed

    • Fix Retry Pattern Bug and Introduce Attempts by @pkritiotis in https://github.com/beatlabs/patron/pull/506
    • Bump github.com/prometheus/client_golang from 1.12.1 to 1.12.2 by @dependabot in https://github.com/beatlabs/patron/pull/507
    • Deterministic start with timestamp offset on rarely populated topic by @koschos in https://github.com/beatlabs/patron/pull/508

    New Contributors

    • @pkritiotis made their first contribution in https://github.com/beatlabs/patron/pull/506

    Full Changelog: https://github.com/beatlabs/patron/compare/v0.69.0...v0.69.1

    Source code(tar.gz)
    Source code(zip)
  • v0.69.0(May 17, 2022)

    What's Changed

    • Bump github.com/aws/aws-sdk-go from 1.43.2 to 1.44.4 by @dependabot in https://github.com/beatlabs/patron/pull/499
    • Bump github.com/elastic/go-elasticsearch/v8 from 8.1.0 to 8.2.0 by @dependabot in https://github.com/beatlabs/patron/pull/500
    • Mongo client support by @mantzas in https://github.com/beatlabs/patron/pull/486
    • Bump github.com/Shopify/sarama from 1.32.0 to 1.33.0 by @dependabot in https://github.com/beatlabs/patron/pull/504

    Full Changelog: https://github.com/beatlabs/patron/compare/v0.68.0...v0.69.0

    Source code(tar.gz)
    Source code(zip)
  • v0.68.0(Apr 29, 2022)

    What's Changed

    • Bump google.golang.org/grpc from 1.45.0 to 1.46.0 by @dependabot in https://github.com/beatlabs/patron/pull/497
    • Add CheckRedirect option to http client by @koschos in https://github.com/beatlabs/patron/pull/498

    Full Changelog: https://github.com/beatlabs/patron/compare/v0.67.0...v0.68.0

    Source code(tar.gz)
    Source code(zip)
  • v0.67.0(Apr 20, 2022)

    What's Changed

    • Bump google.golang.org/grpc from 1.44.0 to 1.45.0 by @dependabot in https://github.com/beatlabs/patron/pull/488
    • Default logger when uninitialized by @mantzas in https://github.com/beatlabs/patron/pull/487
    • Bump actions/setup-go from 2 to 3 by @dependabot in https://github.com/beatlabs/patron/pull/490
    • Bump google.golang.org/protobuf from 1.27.1 to 1.28.0 by @dependabot in https://github.com/beatlabs/patron/pull/489
    • Bump github.com/stretchr/testify from 1.7.0 to 1.7.1 by @dependabot in https://github.com/beatlabs/patron/pull/491
    • Bump github.com/go-redis/redis/v8 from 8.11.4 to 8.11.5 by @dependabot in https://github.com/beatlabs/patron/pull/492
    • Partitions offset by timestamp by @koschos in https://github.com/beatlabs/patron/pull/494

    New Contributors

    • @koschos made their first contribution in https://github.com/beatlabs/patron/pull/494

    Full Changelog: https://github.com/beatlabs/patron/compare/v0.66.0...v0.67.0

    Source code(tar.gz)
    Source code(zip)
  • v0.66.0(Mar 18, 2022)

    What's Changed

    • Fix e2e cleanup by @mantzas in https://github.com/beatlabs/patron/pull/470
    • Linter overhaul by @mantzas in https://github.com/beatlabs/patron/pull/476
    • Bump github.com/elastic/go-elasticsearch/v8 from 8.0.0 to 8.1.0 by @dependabot in https://github.com/beatlabs/patron/pull/482
    • Testing overhaul by @mantzas in https://github.com/beatlabs/patron/pull/479
    • Fixed broken test race condition by @mantzas in https://github.com/beatlabs/patron/pull/477
    • HTTP v2 Component by @mantzas in https://github.com/beatlabs/patron/pull/437
    • Fix Accept Encoding parsing of parts by @GerardRodes in https://github.com/beatlabs/patron/pull/484

    HTTP v2 (Breaking change)

    We have introduced a new HTTP component which is less opinionated and give full control over request and responses. The component is opt-in and will disable the legacy component when used. All functionality from the legacy component is also available. Another feature of the new architecture is that the component accepts and http.Handler router implementation. This effectively allows us to plugin any router we like assuming that it implements the interface. We provide OOTB the router we used in the legacy system which is slim and lightweight. Our v1 release will eventually remove the legacy component and the current will become the default. Check out the HTTP examples (http,http-cache,http-sec) that are already using the new component.

    Breaking changes

    • Middlewares live now under the package middleware inside of http.

    Enjoy and provide feedback to improve it. Thanks

    New Contributors

    • @GerardRodes made their first contribution in https://github.com/beatlabs/patron/pull/484

    Full Changelog: https://github.com/beatlabs/patron/compare/v0.65.1...v0.66.0

    Source code(tar.gz)
    Source code(zip)
  • v0.65.1(Mar 2, 2022)

    What's Changed

    • Bump github.com/Shopify/sarama from 1.31.1 to 1.32.0 by @dependabot in https://github.com/beatlabs/patron/pull/472
    • Bump actions/checkout from 2 to 3 by @dependabot in https://github.com/beatlabs/patron/pull/473
    • Fix command label in redis histogram metrics by @siavashs in https://github.com/beatlabs/patron/pull/475

    New Contributors

    • @siavashs made their first contribution in https://github.com/beatlabs/patron/pull/475

    Full Changelog: https://github.com/beatlabs/patron/compare/v0.65.0...v0.65.1

    Source code(tar.gz)
    Source code(zip)
  • v0.65.0(Feb 22, 2022)

    What's Changed

    • Protobuf V2 Support by @mantzas in https://github.com/beatlabs/patron/pull/450
    • Kafka consumer option: new session callback by @teivah in https://github.com/beatlabs/patron/pull/468
    • Bump github.com/aws/aws-sdk-go from 1.42.51 to 1.43.2 by @dependabot in https://github.com/beatlabs/patron/pull/471

    Full Changelog: https://github.com/beatlabs/patron/compare/v0.64.1...v0.65.0

    Source code(tar.gz)
    Source code(zip)
  • v0.64.1(Feb 15, 2022)

    What's Changed

    • Upgrade dependencies by @mantzas in https://github.com/beatlabs/patron/pull/464

    Full Changelog: https://github.com/beatlabs/patron/compare/v0.64.0...v0.64.1

    Source code(tar.gz)
    Source code(zip)
  • v0.64.0(Feb 11, 2022)

    What's Changed

    • Added a convenience method for removing duplicated messages out of a slice of messages (based on keys) by @peterklijn in https://github.com/beatlabs/patron/pull/457

    New Contributors

    • @peterklijn made their first contribution in https://github.com/beatlabs/patron/pull/457

    Full Changelog: https://github.com/beatlabs/patron/compare/v0.63.2...v0.64.0

    Source code(tar.gz)
    Source code(zip)
  • v0.63.2(Feb 10, 2022)

    What's Changed

    • bugfix: Remove Prometheus Exemplars augmentation from counter metrics without suffix _total by @EvgeniaMartynova-thebeat in https://github.com/beatlabs/patron/pull/460

    Full Changelog: https://github.com/beatlabs/patron/compare/v0.63.1...v0.63.2

    Source code(tar.gz)
    Source code(zip)
  • v0.63.1(Jan 26, 2022)

    What's Changed

    • Bump github.com/prometheus/client_golang from 1.11.0 to 1.12.0 by @dependabot in https://github.com/beatlabs/patron/pull/455
    • Fix correlation ID propagation in SQS v2 publisher by @ashraymehta in https://github.com/beatlabs/patron/pull/454

    New Contributors

    • @ashraymehta made their first contribution in https://github.com/beatlabs/patron/pull/454

    Full Changelog: https://github.com/beatlabs/patron/compare/v0.63.0...v0.63.1

    Source code(tar.gz)
    Source code(zip)
  • v0.63.0(Jan 20, 2022)

    What's Changed

    • Bump github.com/rs/zerolog from 1.26.0 to 1.26.1 by @dependabot in https://github.com/beatlabs/patron/pull/449
    • Prometheus Exemplars Support by @EvgeniaMartynova-thebeat in https://github.com/beatlabs/patron/pull/448

    New Contributors

    • @EvgeniaMartynova-thebeat made their first contribution in https://github.com/beatlabs/patron/pull/448

    Full Changelog: https://github.com/beatlabs/patron/compare/v0.62.1...v0.63.0

    Source code(tar.gz)
    Source code(zip)
  • v0.62.1(Jan 7, 2022)

    What's Changed

    • New linter and upgrades by @mantzas in https://github.com/beatlabs/patron/pull/444
    • Remove Content-Length when using compression by @sgarcez in https://github.com/beatlabs/patron/pull/452

    Full Changelog: https://github.com/beatlabs/patron/compare/v0.62.0...v0.62.1

    Source code(tar.gz)
    Source code(zip)
  • v0.62.0(Dec 21, 2021)

    What's Changed

    • Bump github.com/uber/jaeger-client-go from 2.29.1+incompatible to 2.30.0+incompatible by @dependabot in https://github.com/beatlabs/patron/pull/445
    • Bump google.golang.org/grpc from 1.42.0 to 1.43.0 by @dependabot in https://github.com/beatlabs/patron/pull/447
    • Issue #443 - Startup fail for missing topic or brokers not reachable by @rbroggi in https://github.com/beatlabs/patron/pull/446

    Full Changelog: https://github.com/beatlabs/patron/compare/v0.61.4...v0.62.0

    Source code(tar.gz)
    Source code(zip)
  • v0.61.4(Dec 8, 2021)

    What's Changed

    • Bump github.com/aws/aws-sdk-go from 1.41.3 to 1.42.9 by @dependabot in https://github.com/beatlabs/patron/pull/440
    • Bump github.com/ory/dockertest/v3 from 3.8.0 to 3.8.1 by @dependabot in https://github.com/beatlabs/patron/pull/441
    • Bump github.com/Shopify/sarama from 1.30.0 to 1.30.1 by @dependabot in https://github.com/beatlabs/patron/pull/442

    Full Changelog: https://github.com/beatlabs/patron/compare/v0.61.3...v0.61.4

    Source code(tar.gz)
    Source code(zip)
  • v0.61.3(Nov 16, 2021)

    What's Changed

    • Bump github.com/rs/zerolog from 1.25.0 to 1.26.0 by @dependabot in https://github.com/beatlabs/patron/pull/435
    • Bump google.golang.org/grpc from 1.41.0 to 1.42.0 by @dependabot in https://github.com/beatlabs/patron/pull/439
    • Fix status code tracing, where status code could be -1 by @wimspaargaren in https://github.com/beatlabs/patron/pull/438

    Full Changelog: https://github.com/beatlabs/patron/compare/v0.61.2...v0.61.3

    Source code(tar.gz)
    Source code(zip)
  • v0.61.2(Oct 29, 2021)

    What's Changed

    • Relocate Kafka component config by @mantzas in https://github.com/beatlabs/patron/pull/433

    Breaking change. The location of the DefaultConsumerSaramaConfig has moved to github.com/beatlabs/patron/component/kafka.

    Full Changelog: https://github.com/beatlabs/patron/compare/v0.61.1...v0.61.2

    Source code(tar.gz)
    Source code(zip)
  • v0.61.1(Oct 29, 2021)

    What's Changed

    • Kafka producer metric topic label fix by @mantzas in https://github.com/beatlabs/patron/pull/432

    Full Changelog: https://github.com/beatlabs/patron/compare/v0.61.0...v0.61.1

    Source code(tar.gz)
    Source code(zip)
  • v0.61.0(Oct 26, 2021)

    What's Changed

    • Disable Jaeger logging integration by @gmaz42 in https://github.com/beatlabs/patron/pull/425
    • Require Sarama configuration for all producers/consumers [breaking] by @gmaz42 in https://github.com/beatlabs/patron/pull/409
    • Set status code in dynamicCompressionResponseWriter early exit by @tpaschalis in https://github.com/beatlabs/patron/pull/429
    • Feature: new HTTP server metrics with full status code by @gmaz42 in https://github.com/beatlabs/patron/pull/411

    Breaking change

    This release introduces multiple breaking changes related to specifying a Sarama configuration for all consumer/producer use cases.

    As an user of Patron you will now have to make a choice about which consumer or producer configuration to use; you can use the utility functions client/kafka/v2.DefaultConsumerConfig or DefaultProducerConfig, or create and provide your own using sarama.NewConfig.

    For more information about eventual consistency and transactions behavior in Kafka, please see https://www.confluent.io/blog/transactions-apache-kafka/

    This new behavior in Patron coincidentally now matches what the official Java Kafka client does, see: https://blogs.apache.org/kafka/entry/what-s-new-in-apache6

    Follows a comprehensive list of the introduced breaking changes:

    • client/kafka/v2: New now requires Sarama configuration
    • client/kafka/v2: Builder.WithConfig is deleted
    • component/async/kafka/group: New requires a new parameter for Sarama configuration
    • component/async/kafka: DefaultSaramaConfig deleted, use client/kafka/v2.DefaultConsumerConfig or DefaultProducerConfig instead
    • component/async/kafka: New requires a new parameter for Sarama configuration
    • component/kafka/group: New requires a new parameter for Sarama configuration
    • component/kafka/group: SaramaConfig option func deleted
    • component/kafka: DefaultSaramaConfig deleted, use client/kafka/v2.DefaultConsumerConfig or DefaultProducerConfig instead

    Full Changelog: https://github.com/beatlabs/patron/compare/v0.60.2...v0.61.0

    Source code(tar.gz)
    Source code(zip)
  • v0.60.2(Oct 15, 2021)

    What's Changed

    • Bump github.com/ory/dockertest/v3 from 3.7.0 to 3.8.0 by @dependabot in https://github.com/beatlabs/patron/pull/422
    • Bump google.golang.org/grpc from 1.27.1 to 1.41.0 by @dependabot in https://github.com/beatlabs/patron/pull/424
    • Remove HTTP client context by @mantzas in https://github.com/beatlabs/patron/pull/426
    • Upgrade dependencies by @mantzas in https://github.com/beatlabs/patron/pull/427

    Full Changelog: https://github.com/beatlabs/patron/compare/v0.58.0...v0.60.2

    Source code(tar.gz)
    Source code(zip)
  • v0.58.0(Oct 7, 2021)

    Breaking change

    The Sarama upgrade requires minimum Go 1.16.

    What's Changed

    • Update to Go 1.16 by @gmaz42 in https://github.com/beatlabs/patron/pull/421
    • Update to Sarama v1.30.0 by @gmaz42 in https://github.com/beatlabs/patron/pull/420

    Full Changelog: https://github.com/beatlabs/patron/compare/v0.57.0...v0.58.0

    Source code(tar.gz)
    Source code(zip)
Owner
Beat Labs
Beat Labs
Goal is a toolkit for high productivity web development in Go language in the spirit of Revel Framework that is built around the concept of code generation.

Goal Goal is a set of tools for high productivity web development in Go language. Goal, being mostly inspired by Revel Framework and its discussions,

null 88 Sep 27, 2021
go-zero is a web and rpc framework written in Go. It's born to ensure the stability of the busy sites with resilient design. Builtin goctl greatly improves the development productivity.

go-zero English | 简体中文 0. what is go-zero go-zero is a web and rpc framework that with lots of engineering practices builtin. It’s born to ensure the

好未来技术 22.1k Jan 2, 2023
go-zero is a web and rpc framework that with lots of engineering practices builtin.

go-zero is a web and rpc framework that with lots of engineering practices builtin. It’s born to ensure the stability of the busy services with resilience design, and has been serving sites with tens of millions users for years.

null 537 Jan 6, 2023
Gearbox :gear: is a web framework written in Go with a focus on high performance

gearbox ⚙️ is a web framework for building micro services written in Go with a focus on high performance. It's built on fasthttp which is up to 10x fa

Gearbox 696 Jan 3, 2023
Gearbox :gear: is a web framework written in Go with a focus on high performance

gearbox ⚙️ is a web framework for building micro services written in Go with a focus on high performance. It's built on fasthttp which is up to 10x fa

Gearbox 695 Dec 29, 2022
Kubewrap - kubewrap is an kubernetes command line utility with a focus to explore the kubernetes REST API's leveraging the go libraries available along with golang and cobra packages.

Kubewrap kubewrap is an kubernetes cli wrapper with a focus to explore the kubernetes REST API's leveraging the go libraries available along with gola

Daniel Pickens 1 Nov 20, 2022
This library provides a simple framework of microservice, which includes a configurator, a logger, metrics, and of course the handler

Microservice The framework for the creation of microservices, written in Golang. (note: http microservice) Architecture microservice includes: handle

Eduard 109 Dec 30, 2022
Best simple, lightweight, powerful and really fast Api with Golang (Fiber, REL, Dbmate) PostgreSqL Database and Clean Architecture

GOLANG FIBER API (CLEAN ARCHITECTURE) Best simple, lightweight, powerful and really fast Api with Golang (Fiber, REL, Dbmate) PostgreSqLDatabase using

Elias Champi 3 Sep 2, 2022
A Microservice Toolkit from The New York Times

Gizmo Microservice Toolkit This toolkit provides packages to put together server and pubsub daemons with the following features: Standardized configur

The New York Times 3.7k Dec 27, 2022
Flamingo Framework and Core Library. Flamingo is a go based framework for pluggable web projects. It is used to build scalable and maintainable (web)applications.

Flamingo Framework Flamingo is a web framework based on Go. It is designed to build pluggable and maintainable web projects. It is production ready, f

Flamingo 343 Jan 5, 2023
Golanger Web Framework is a lightweight framework for writing web applications in Go.

/* Copyright 2013 Golanger.com. All rights reserved. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except

golanger 298 Nov 14, 2022
The jin is a simplified version of the gin web framework that can help you quickly understand the core principles of a web framework.

jin About The jin is a simplified version of the gin web framework that can help you quickly understand the core principles of a web framework. If thi

null 8 Jul 14, 2022
laravel for golang,goal,fullstack framework,api framework

laravel for golang,goal,fullstack framework,api framework

桥边红药 17 Feb 24, 2022
Gin is a HTTP web framework written in Go (Golang).

Gin is a HTTP web framework written in Go (Golang). It features a Martini-like API with much better performance -- up to 40 times faster. If you need smashing performance, get yourself some Gin.

Gin-Gonic 65.5k Jan 3, 2023
An ideally refined web framework for Go.

Air An ideally refined web framework for Go. High-performance? Fastest? Almost all web frameworks are using these words to tell people that they are t

Aofei Sheng 421 Dec 15, 2022
An opinionated productive web framework that helps scaling business easier.

appy An opinionated productive web framework that helps scaling business easier, i.e. focus on monolith first, only move to microservices with GRPC la

appist 128 Nov 4, 2022
BANjO is a simple web framework written in Go (golang)

BANjO banjo it's a simple web framework for building simple web applications Install $ go get github.com/nsheremet/banjo Example Usage Simple Web App

Nazarii Sheremet 20 Sep 27, 2022
beego is an open-source, high-performance web framework for the Go programming language.

Beego Beego is used for rapid development of enterprise application in Go, including RESTful APIs, web apps and backend services. It is inspired by To

astaxie 592 Jan 1, 2023
High performance, minimalist Go web framework

Supported Go versions As of version 4.0.0, Echo is available as a Go module. Therefore a Go version capable of understanding /vN suffixed imports is r

LabStack LLC 24.6k Jan 2, 2023