examples

package
v0.28.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Oct 22, 2019 License: Apache-2.0 Imports: 3 Imported by: 0

README

example

The following example will show off the usage of patron involving all components implemented. The processing will be kicked of by sending a request to the HTTP component. The flow then will be the following:

  • HTTP -> RabbitMQ publish
  • RabbitMQ consumer -> kafka publish
  • Kafka consumer -> log to stdout
  • Publish message to AWS SNS -> Consume it with AWS SQS

Since tracing instrumentation is in place we can observer the flow in jaeger.

Prerequisites

  • Docker
  • Docker compose

Setting up environment

To run the full example we need to start jaeger and prometheus. We can startup both of them using docker-compose with the following command.

docker-compose up -d

To tear down the above just:

docker-compose down

Running the examples

Start first service:

go run examples/first/main.go

Start second service:

go run examples/second/main.go

Start third service:

go run examples/third/main.go

Start fourth service:

go run examples/fourth/main.go

Start fifth service:

go run examples/fifth/main.go

and the use curl to send a request:

curl -d '{"Firstname":"John", "Lastname": "Doe"}' -H "Content-Type: application/json" -X POST http://localhost:50000

After that head over to jaeger and prometheus.

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type User added in v0.23.0

type User struct {
	Firstname            *string  `protobuf:"bytes,1,req,name=Firstname" json:"Firstname,omitempty"`
	Lastname             *string  `protobuf:"bytes,2,opt,name=Lastname" json:"Lastname,omitempty"`
	XXX_NoUnkeyedLiteral struct{} `json:"-"`
	XXX_unrecognized     []byte   `json:"-"`
	XXX_sizecache        int32    `json:"-"`
}

func (*User) Descriptor added in v0.23.0

func (*User) Descriptor() ([]byte, []int)

func (*User) GetFirstname added in v0.23.0

func (m *User) GetFirstname() string

func (*User) GetLastname added in v0.23.0

func (m *User) GetLastname() string

func (*User) ProtoMessage added in v0.23.0

func (*User) ProtoMessage()

func (*User) Reset added in v0.23.0

func (m *User) Reset()

func (*User) String added in v0.23.0

func (m *User) String() string

func (*User) XXX_DiscardUnknown added in v0.23.0

func (m *User) XXX_DiscardUnknown()

func (*User) XXX_Marshal added in v0.23.0

func (m *User) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)

func (*User) XXX_Merge added in v0.23.0

func (m *User) XXX_Merge(src proto.Message)

func (*User) XXX_Size added in v0.23.0

func (m *User) XXX_Size() int

func (*User) XXX_Unmarshal added in v0.23.0

func (m *User) XXX_Unmarshal(b []byte) error

Directories

Path Synopsis

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL