Skip to content

Commit

Permalink
Merge pull request #169 from jehiah/client_id_169
Browse files Browse the repository at this point in the history
IDENTIFY: send 1.0 compatible client_id and hostname fields
  • Loading branch information
jehiah authored Feb 22, 2017
2 parents 268c2a1 + ce384ee commit ed7ef0d
Show file tree
Hide file tree
Showing 4 changed files with 9 additions and 7 deletions.
6 changes: 4 additions & 2 deletions nsq/async.py
Original file line number Diff line number Diff line change
Expand Up @@ -352,8 +352,10 @@ def send_rdy(self, value):

def _on_connect(self, **kwargs):
identify_data = {
'short_id': self.short_hostname,
'long_id': self.hostname,
'short_id': self.short_hostname, # TODO remove when deprecating pre 1.0 support
'long_id': self.hostname, # TODO remove when deprecating pre 1.0 support
'client_id': self.short_hostname,
'hostname': self.hostname,
'heartbeat_interval': self.heartbeat_interval,
'feature_negotiation': True,
'tls_v1': self.tls_v1,
Expand Down
2 changes: 1 addition & 1 deletion nsq/version.py
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
# also update in setup.py
__version__ = '0.7.1'
__version__ = '0.8-alpha'
4 changes: 2 additions & 2 deletions setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ def run_tests(self):


# also update in nsq/version.py
version = '0.7.1'
version = '0.8-alpha'


setup(
Expand All @@ -39,7 +39,7 @@ def run_tests(self):
'python-snappy', 'tornado'],
cmdclass={'test': PyTest},
classifiers=[
'Development Status :: 4 - Beta',
'Development Status :: 6 - Mature',
'License :: OSI Approved :: MIT License',
'Programming Language :: Python :: 2',
'Programming Language :: Python :: 2.6',
Expand Down
4 changes: 2 additions & 2 deletions tests/test_sync.py
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ def test_sync_authenticate_subscribe():
c = sync.SyncConn()
c.connect("127.0.0.1", 4150)

c.send(protocol.identify({'short_id': 'test', 'long_id': 'test.example'}))
c.send(protocol.identify({'short_id': 'test', 'long_id': 'test.example', 'client_id': 'test', 'hostname':'test.example'}))
c.send(protocol.subscribe('test', 'ch'))

mock_response_write(c, protocol.FRAME_TYPE_RESPONSE, b'OK')
Expand All @@ -54,7 +54,7 @@ def test_sync_receive_messages():
c = sync.SyncConn()
c.connect("127.0.0.1", 4150)

c.send(protocol.identify({'short_id': 'test', 'long_id': 'test.example'}))
c.send(protocol.identify({'short_id': 'test', 'long_id': 'test.example', 'client_id': 'test', 'hostname':'test.example'}))
c.send(protocol.subscribe('test', 'ch'))

mock_response_write(c, protocol.FRAME_TYPE_RESPONSE, b'OK')
Expand Down

0 comments on commit ed7ef0d

Please sign in to comment.