message

package
v1.0.0 Latest Latest
Warning

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

Go to latest
Published: May 14, 2016 License: MIT Imports: 11 Imported by: 6

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type HttpRequestMessage

type HttpRequestMessage struct {
	// RabbitMQ message
	Delivery amqp.Delivery

	// Message Id is retrieved from the RabbitMQ header message_id.
	// If not provided in the header, it is generated by concatenating the md5 hash of
	// the message body with the original RabbitMQ timestamp, if the timestamp is available.
	// The generated format will be either md5 or md5-timestamp.
	// e.g. "ee6ad4b95b3970ed69b847db88757922-1462230252"
	MessageId string

	// Http request fields
	Method  string
	Url     string
	Headers map[string]string
	Body    string

	// Time when message was originally created (if timestamp plugin was installed)
	Timestamp int64

	// Time when message will expire, as provided in RabbitMQ message header.
	// If not provided, this value is 0 and the expiration is calculated from the DefaultTTL setting.
	Expiration int64

	// Retry history from RabbitMQ headers
	RetryCnt           int
	FirstRejectionTime int64

	// Http request status
	HttpStatusMsg string
	HttpRespBody  string
	HttpErr       error

	// Message disposition
	Drop    bool // Drop/Retry indicator
	Expired bool // Message expired
}

HttpRequestMessage holds all info and status for a RabbitMQ message and its associated http request.

func (*HttpRequestMessage) CheckExpiration

func (msg *HttpRequestMessage) CheckExpiration(waitDelay, defaultTTL int)

func (*HttpRequestMessage) HttpRequest

func (msg *HttpRequestMessage) HttpRequest(ackCh chan HttpRequestMessage, defaultMethod string, timeout int)

func (*HttpRequestMessage) Parse

func (msg *HttpRequestMessage) Parse(rmqDelivery amqp.Delivery, logFile *logfile.Logger) (err error)

Jump to

Keyboard shortcuts

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