Documentation ¶
Overview ¶
Package aliyunmns Message queue adapter on AliyunMNS.
Index ¶
- Constants
- Variables
- type AgentManager
- type Consumer
- type Producer
- type Remoter
- func (o *Remoter) Build(ctx context.Context, task *base.Task) (err error)
- func (o *Remoter) BuildById(ctx context.Context, id int) (err error)
- func (o *Remoter) Destroy(ctx context.Context, task *base.Task) (err error)
- func (o *Remoter) DestroyById(ctx context.Context, id int) (err error)
- func (o *Remoter) Processor() process.Processor
- type TopicMessage
Constants ¶
View Source
const ( DefaultLoggingEnable = true DefaultMaxMessageSize = 65536 DefaultMessageRetentionPeriod = 604800 DefaultNotifyContentFormat = "JSON" DefaultNotifyStrategy = mns.BACKOFF_RETRY DefaultPollingWaitSeconds = 30 DefaultSlices = 0 DefaultVisibilityTimeout = 30 )
Variables ¶
View Source
var ( Agent AgentManager RegexMessageNotExist = regexp.MustCompile(`code\s*:\s*MessageNotExist`) RegexQueueNotExist = regexp.MustCompile(`code\s*:\s*QueueNotExist`) RegexSubscriptionNotExist = regexp.MustCompile(`code\s*:\s*SubscriptionNotExist`) RegexTopicNotExist = regexp.MustCompile(`code\s*:\s*TopicNotExist`) )
View Source
var (
TopicMessagePool *sync.Pool
)
Functions ¶
This section is empty.
Types ¶
type AgentManager ¶
type AgentManager interface { // Build // create remote relation if not exists. Build(ctx context.Context, task *base.Task) error // Destroy // delete remote relation if exists. Destroy(ctx context.Context, task *base.Task) error // GenQueueName // generate and return queue name. // // Agent.GenQueueName(1) // return "X-Q1" GenQueueName(id int) string // GenSubscriptionName // generate and return subscription name. // // Agent.GenSubscriptionName(1) // return "X-S1" GenSubscriptionName(id int) string // GenTopicName // generate and return topic name. // // Agent.GenTopicName("Topic") // return "X-Topic" GenTopicName(name string) string // GetQueueClient // return queue client instance. GetQueueClient(id int) mns.AliMNSQueue // GetQueueManager // return queue manager interface. GetQueueManager() mns.AliQueueManager // GetTopicClient // return topic client instance. GetTopicClient(name string) mns.AliMNSTopic // GetTopicManager // return topic manager interface. GetTopicManager() mns.AliTopicManager }
AgentManager interface of aliyunmns agent.
type Consumer ¶
type Consumer struct {
// contains filtered or unexported fields
}
Consumer struct for aliyun mns consumer.
func NewConsumer ¶
type Producer ¶
type Producer struct {
// contains filtered or unexported fields
}
Producer struct for aliyun mns producer.
func NewProducer ¶
func NewProducer() *Producer
type Remoter ¶
type Remoter struct {
// contains filtered or unexported fields
}
Remoter struct for aliyun mns remoter.
func NewRemoter ¶
func NewRemoter() *Remoter
func (*Remoter) DestroyById ¶
type TopicMessage ¶
type TopicMessage struct { Message string `json:"Message"` MessageId string `json:"MessageId"` TopicName string `json:"TopicName"` }
func (*TopicMessage) Release ¶
func (o *TopicMessage) Release()
Click to show internal directories.
Click to hide internal directories.