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

A syntax error in readme #38

Closed
zhangyf92 opened this issue Aug 28, 2017 · 1 comment
Closed

A syntax error in readme #38

zhangyf92 opened this issue Aug 28, 2017 · 1 comment

Comments

@zhangyf92
Copy link

https://github.com/Azure/azure-event-hubs-node/blob/3be0b729312e506720e323bdc94172d341fb128e/send_receive/README.md#example-3---create-a-sender-v1

var EventHubClient = require('azure-event-hubs').Client;

var client = EventHubClient.fromConnectionString('Endpoint=sb://my-servicebus-namespace.servicebus.windows.net/;SharedAccessKeyName=my-SA-name;SharedAccessKey=my-SA-key', 'myeventhub')
client.open()
       .then(function() {
        client.createSender();
      })
      .then(function (tx) {
        tx.on('errorReceived', function (err) { console.log(err); });
        tx.send({ contents: 'Here is some text sent to partition key my-pk.' }, 'my-pk'); 
      });

it should be

       .then(function() {
        return client.createSender();
      })

Btw, createSender v1 does not work properly, you can input whatever num in postion 'my-pk', and this function will send the message to a random partition.

I put '200' in the second param postion, and it just sended my message to partition 1.

CreateSender v2 is ok.

Sorry for my bad grammar.

@amarzavery
Copy link
Collaborator

Thanks for reporting this issue. We have a new preview version "0.1.0" of the event hubs client. This client was re-written from scratch. Please try the new version and let us know if you still see issues. You can find examples over here.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants