Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

bug(types) IHeaders interface #467

Merged
merged 1 commit into from
Aug 14, 2019
Merged

bug(types) IHeaders interface #467

merged 1 commit into from
Aug 14, 2019

Conversation

mkaufmaner
Copy link
Contributor

The existing IHeaders interface defined the property values as a string when they are actually buffers.

{ topic: 'math.sum',
  partition: 0,
  message:
   { magicByte: 2,
     attributes: 0,
     timestamp: '1565801225655',
     offset: '10',
     key:
      <Buffer 32 61 62 63 39 34 65 31 2d 30 65 66 34 2d 34 33 36 34 2d 39 38 63 66 2d 31 34 34 66 37 63 64 32 39 38 66 39>,
     value: <Buffer 31>,
     headers:
      { 'correlation-id':
         <Buffer 32 61 62 63 39 34 65 31 2d 30 65 66 34 2d 34 33 36 34 2d 39 38 63 66 2d 31 34 34 66 37 63 64 32 39 38 66 39> },
     isControlRecord: false,
     batchContext:
      { firstOffset: '10',
        firstTimestamp: '1565801225655',
        partitionLeaderEpoch: 0,
        inTransaction: false,
        isControlBatch: false,
        lastOffsetDelta: 4,
        producerId: '-1',
        producerEpoch: 0,
        firstSequence: 0,
        maxTimestamp: '1565801225655',
        magicByte: 2 } } }

The existing IHeaders interface defined the property values as a string when they are actually buffers.

```
{ topic: 'math.sum',
  partition: 0,
  message:
   { magicByte: 2,
     attributes: 0,
     timestamp: '1565801225655',
     offset: '10',
     key:
      <Buffer 32 61 62 63 39 34 65 31 2d 30 65 66 34 2d 34 33 36 34 2d 39 38 63 66 2d 31 34 34 66 37 63 64 32 39 38 66 39>,
     value: <Buffer 31>,
     headers:
      { 'correlation-id':
         <Buffer 32 61 62 63 39 34 65 31 2d 30 65 66 34 2d 34 33 36 34 2d 39 38 63 66 2d 31 34 34 66 37 63 64 32 39 38 66 39> },
     isControlRecord: false,
     batchContext:
      { firstOffset: '10',
        firstTimestamp: '1565801225655',
        partitionLeaderEpoch: 0,
        inTransaction: false,
        isControlBatch: false,
        lastOffsetDelta: 4,
        producerId: '-1',
        producerEpoch: 0,
        firstSequence: 0,
        maxTimestamp: '1565801225655',
        magicByte: 2 } } }
```
@tulios
Copy link
Owner

tulios commented Aug 14, 2019

Thanks, that's what happens when you add type definitions later in the project

@tulios tulios merged commit b1bf53e into tulios:master Aug 14, 2019
@tulios
Copy link
Owner

tulios commented Aug 14, 2019

The pre-release version 1.11.0-beta.4 was published with the change

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

Successfully merging this pull request may close these issues.

2 participants