All Projects → ayeo-flex-org → pulsar-flex

ayeo-flex-org / pulsar-flex

Licence: MIT license
Pulsar Flex is a modern Apache Pulsar client for Node.js, developed to be independent of C++.

Programming Languages

javascript
184084 projects - #8 most used programming language

Projects that are alternatives of or similar to pulsar-flex

php-kafka-lib
PHP Kafka producer / consumer library with PHP Avro support, based on php-rdkafka
Stars: ✭ 38 (-11.63%)
Mutual labels:  consumer, producer
Confluent Kafka Go
Confluent's Apache Kafka Golang client
Stars: ✭ 3,047 (+6986.05%)
Mutual labels:  consumer, producer
youtube-dl-nas
youtube download queue websocket server with login for private NAS.
Stars: ✭ 136 (+216.28%)
Mutual labels:  consumer, producer
Qmq
QMQ是去哪儿网内部广泛使用的消息中间件,自2012年诞生以来在去哪儿网所有业务场景中广泛的应用,包括跟交易息息相关的订单场景; 也包括报价搜索等高吞吐量场景。
Stars: ✭ 2,420 (+5527.91%)
Mutual labels:  consumer, producer
rocketmq
RocketMQ client for go supportting producer and consumer.
Stars: ✭ 29 (-32.56%)
Mutual labels:  consumer, producer
Kafka Go
Kafka library in Go
Stars: ✭ 4,200 (+9667.44%)
Mutual labels:  consumer, producer
frizzle
The magic message bus
Stars: ✭ 14 (-67.44%)
Mutual labels:  consumer, producer
Kafka Influxdb
High performance Kafka consumer for InfluxDB. Supports collectd message formats.
Stars: ✭ 206 (+379.07%)
Mutual labels:  consumer
aop
AMQP on Pulsar protocol handler
Stars: ✭ 93 (+116.28%)
Mutual labels:  pulsar
Remora
Kafka consumer lag-checking application for monitoring, written in Scala and Akka HTTP; a wrap around the Kafka consumer group command. Integrations with Cloudwatch and Datadog. Authentication recently added
Stars: ✭ 183 (+325.58%)
Mutual labels:  consumer
Kafka Zk Restapi
Kafka Zookeeper RESTful API to perform topic/consumer group administration/metric(offset\lag\message) collection and monitor
Stars: ✭ 121 (+181.4%)
Mutual labels:  consumer
rabbitmq-consumer
A configurable RabbitMQ consumer made in Rust, useful for a stable and reliable CLI commands processor.
Stars: ✭ 25 (-41.86%)
Mutual labels:  consumer
ember-contextual-services
Services in Ember are scoped to the app as a whole and are singletons. Sometimes you don't want that. :) This addon provides ephemeral route-based services.
Stars: ✭ 20 (-53.49%)
Mutual labels:  consumer
retail-banking
Consumer Banking Application
Stars: ✭ 25 (-41.86%)
Mutual labels:  consumer
tgip
TGIP (TGI Pulsar) is a weekly live video streaming about Apache Pulsar and its ecosystem.
Stars: ✭ 17 (-60.47%)
Mutual labels:  pulsar
aws-kinesis-consumer
Consume an AWS Kinesis Data Stream to look over the records from a terminal.
Stars: ✭ 23 (-46.51%)
Mutual labels:  consumer
Simpleue
PHP queue worker and consumer - Ready for AWS SQS, Redis, Beanstalkd and others.
Stars: ✭ 124 (+188.37%)
Mutual labels:  consumer
node-bunnymq
BunnyMQ is an amqp.node wrapper to ease common AMQP usages (RPC, pub/sub, channel/connection handling etc.).
Stars: ✭ 20 (-53.49%)
Mutual labels:  consumer
messaging-polyglot
RabbitMQ Messaging Polyglot with Java, ColdFusion, CommandBox, Groovy and more
Stars: ✭ 18 (-58.14%)
Mutual labels:  consumer
Swadeshi
Implementing a Web Based solution through which farmers can participate in a commodity exchange market
Stars: ✭ 21 (-51.16%)
Mutual labels:  consumer

PulsarFlex

Apache Pulsar® client for Node.js

Report Bug · Request Feature

About

PulsarFlex is a modern Apache Pulsar client for Node.js.

It was developed because the dependency in the official c++ external libraries does not fit some use cases.

Supports all os platforms that can run nodejs.

Features

  • Producer
    • Access Modes
      • Exclusive
      • Shared
    • Send types
      • Batch
      • Single Message
    • Message Properties
    • Reconnection built in
  • Subscriptions
    • Subscription types
      • Exclusive
      • Fail over
      • Shared
      • Key_Shared
    • Acks
      • Specific ack
      • Cumulative ack
      • Automatic ack
      • Negative ack
    • Reconnection built in
    • Check redelivery count, increases on redeliver in Shared and Key_Shared modes
  • Authentication
    • JWT

Getting Started

npm install pulsar-flex

Usage

const { Producer, Consumer, logLevel } = require('pulsar-flex')

const producer = new Producer({
  topic: "persistent://public/default/my-topic",
  discoveryServers: ['pulsar-host:6650'],
  //If you dont provide any jwt token it will use no auth
  jwt: process.env.JWT_TOKEN,
  producerAccessMode: Producer.ACCESS_MODES.SHARED,
  logLevel: logLevel.INFO
  // you can also provide logCreator function
})

const consumer = new Consumer({
  topic: "persistent://public/default/my-topic",
  subscription: "my-subscription",
  discoveryServers: ['pulsar-host:6650'],
  jwt: process.env.JWT_TOKEN,
  subType: Consumer.SUB_TYPES.EXCLUSIVE,
  consumerName: 'Consumer name',
  receiveQueueSize: 1000,
  logLevel: logLevel.INFO,
  // you can also provide logCreator function
})

const run = async () => {
  await producer.create();
  // you can also send single message using sendMessage function
  await producer.sendBatch({messages: [
    {
      properties: {pulsar: "flex"}, 
      payload: 'Ayeo' 
    },
    {
      properties: {pulsar: "flex"},
      payload: 'Ayeo'
    }
  ]});

  await consumer.subscribe();

  consumer.onStateChange(({previousState, newState}) => {
      console.log(`Consumer state has changed from ${previousState} to ${newState}.`);
    };
  );

  await consumer.run({
    onMessage: async ({ ack, message, properties, redeliveryCount }) => {
      await ack(); // Default is individual ack
      // await ack({type: Consumer.ACK_TYPES.CUMULATIVE});
      console.log({
        message,
        properties,
        redeliveryCount,
      })
    }, autoAck: false, // specify true in order to use automaticAck
  });
}

run().catch(console.error)

Contributing

We would love to get help from the community in order to accelerate and expose the latest features of pulsar.

License

MIT LICENSE

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].