Security News
tea.xyz Spam Plagues npm and RubyGems Package Registries
Tea.xyz, a crypto project aimed at rewarding open source contributions, is once again facing backlash due to an influx of spam packages flooding public package registries.
@vtfk/azure-servicebus-queue
Advanced tools
Readme
High-level API for Azure Servicebus Queue operations.
Supports to send and receive messages >64kb by storing and retrieving from blob storage.
Uses the @azure/service-bus SDK
npm i --save @vtfk/azure-servicebus-queue
Get connection string for Service Bus & names for Queues/Topics/Subscriptions
const serviceBusClient = require('@vtfk/azure-servicebus-queue')({
connectionString: '<Servicebus Connection String>'
/* Uncomment to send and receive messages >64kb
storageConnectionString: '<Blob Service SAS URL>'
storageContainerName: '<Container name>'
*/
})
TODO
TODO
First, connect to the desired topic
const topic = serviceBusClient.topic('topicName')
Looks at mesages but don't delete
const limit = 6
const messages = await topic.peek(limit)
Returns an array of max 6 messages.
const messages = await topic.peekBySequenceNumber('<sequenceNumber>')
const message = { body: 'message' }
await topic.send(message)
const limit = 10
const timeoutInSeconds = 1
const messages = await topic.receive(limit, timeoutInSeconds)
const messages = [{ body: '1' }, { body: '2' }]
await topic.sendBatch(messages)
const dateToSend = new Date().toISOString()
const message = { body: 'message' }
await topic.scheduleMessage(dateToSend, message)
const dateToSend = new Date().toISOString()
const messages = [{ body: '1' }, { body: '2' }]
await topic.scheduleMessages(dateToSend, messages)
First, connect to the desired queue
const queue = serviceBusClient.queue(queueName)
Looks at mesages but don't delete
const limit = 6
const messages = await queue.peek(limit)
Returns an array of max 6 messages.
const messages = await queue.peekBySequenceNumber('<sequenceNumber>')
const message = { body: 'message' }
await queue.send(message)
const limit = 10
const timeoutInSeconds = 1
const messages = await queue.receive(limit, timeoutInSeconds)
const messages = [{ body: '1' }, { body: '2' }]
await queue.sendBatch(messages)
const dateToSend = new Date().toISOString()
const message = { body: 'message' }
await queue.scheduleMessage(dateToSend, message)
const dateToSend = new Date().toISOString()
const messages = [{ body: '1' }, { body: '2' }]
await queue.scheduleMessages(dateToSend, messages)
Inside storage you will find readBigMessage
and sendBigMessage
.
These will use the storageConnectionString
and storageContainerName
arguments to get the correct blob.
Store a message and get the ID in return.
const message = 'A message that is to big for the servicebus queue'
const fileId = await serviceBusClient.storage.sendBigMessage(message)
Reads a message from the configured blob storage with a specified ID.
Useful if a function binding is used for listening to new messages.
const fileId = '5266176d-dc5f-4304-b87e-5a4ef78a29b1.json'
const message = await serviceBusClient.storage.readBigMessage(fileId)
Returns the content of the blob with that ID.
To run example.js
create file .env
in project root with following content
QUEUE_NAME=<queue name>
QUEUE_CONNECTION_STRING=<Servicebus Connection String>
BLOB_SERVICE_SAS_URL=<Blob Service SAS URL> # Only needed for bigfile example
BLOB_CONTAINER_NAME=<Container name> # Only needed for bigfile example
And run npm run example
or npm run example-bigfile
(to test with messages >64kb)
FAQs
High-level API for Azure Servicebus Queue operations
The npm package @vtfk/azure-servicebus-queue receives a total of 0 weekly downloads. As such, @vtfk/azure-servicebus-queue popularity was classified as not popular.
We found that @vtfk/azure-servicebus-queue demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 4 open source maintainers collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Security News
Tea.xyz, a crypto project aimed at rewarding open source contributions, is once again facing backlash due to an influx of spam packages flooding public package registries.
Security News
As cyber threats become more autonomous, AI-powered defenses are crucial for businesses to stay ahead of attackers who can exploit software vulnerabilities at scale.
Security News
UnitedHealth Group disclosed that the ransomware attack on Change Healthcare compromised protected health information for millions in the U.S., with estimated costs to the company expected to reach $1 billion.