Skip to content
This repository has been archived by the owner on Dec 8, 2023. It is now read-only.

Commit

Permalink
Merge pull request #19 from acuderman/feature/enable-queue-publish-he…
Browse files Browse the repository at this point in the history
…aders

Add headers support on queue publish
  • Loading branch information
javaducky authored Nov 4, 2022
2 parents 224d7cf + 8f7f43b commit 4f25f55
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 0 deletions.
3 changes: 3 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -68,6 +68,9 @@ export default function () {
// exchange: '',
// mandatory: false,
// immediate: false,
// headers: {
// 'header-1': '',
// },
})

const listener = function(data) { console.log('received data: ' + data) }
Expand Down
2 changes: 2 additions & 0 deletions amqp.go
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@ type Options struct {
type PublishOptions struct {
QueueName string
Body string
Headers amqpDriver.Table
Exchange string
ContentType string
Mandatory bool
Expand Down Expand Up @@ -77,6 +78,7 @@ func (amqp *AMQP) Publish(options PublishOptions) error {
}()

publishing := amqpDriver.Publishing{
Headers: options.Headers,
ContentType: options.ContentType,
Body: []byte(options.Body),
}
Expand Down

0 comments on commit 4f25f55

Please sign in to comment.