Skip to content

glebteterin/go-azurequeue

Repository files navigation

Go client for Azure Service Bus Queue

GoDoc Build status codecov

Install and Use:

Install

$ go get -u github.com/g-rad/go-azurequeue

or if you use dep, within your repo run:

$ dep ensure -add github.com/g-rad/go-azurequeue

If you need to install Go, follow the official instructions.

Use

Init Client
import queue "github.com/g-rad/go-azurequeue" cli := queue.QueueClient{ Namespace: "my-test", KeyName: "RootManageSharedAccessKey", KeyValue: "ErCWbtgArb55Tqqu9tXgdCtopbZ44pMH01sjpMrYGrE=", QueueName: "my-queue", Timeout: 60, }
Send Message
// create message msg := queue.NewMessage(]byte("Hello!")) msg.Properties.Set("Property1", "Value1") msg.Properties.Set("Property2", "Value2") // send message cli.SendMessage(&msg)
Receive Next Message
msg, err := cli.GetMessage()
Unlock Message

If you failed to process a message, unlock it for processing by other receivers.

cli.UnlockMessage(&msg)
Delete Message

This operation completes the processing of a locked message and deletes it from the queue.

cli.DeleteMessage(&msg)

About

Go client for Azure Service Bus Queue

Topics

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Contributors 2

  •  
  •  

Languages