{"action":"created","issue":{"url":"https://api.github.com/repos/moleculer-java/moleculer-java/issues/8","repository_url":"https://api.github.com/repos/moleculer-java/moleculer-java","labels_url":"https://api.github.com/repos/moleculer-java/moleculer-java/issues/8/labels{/name}","comments_url":"https://api.github.com/repos/moleculer-java/moleculer-java/issues/8/comments","events_url":"https://api.github.com/repos/moleculer-java/moleculer-java/issues/8/events","html_url":"https://github.com/moleculer-java/moleculer-java/issues/8","id":349873565,"node_id":"MDU6SXNzdWUzNDk4NzM1NjU=","number":8,"title":"using SpringRegistrator doesn't work - services are not discoverable","user":{"login":"cameronbraid","id":672405,"node_id":"MDQ6VXNlcjY3MjQwNQ==","avatar_url":"https://avatars3.githubusercontent.com/u/672405?v=4","gravatar_id":"","url":"https://api.github.com/users/cameronbraid","html_url":"https://github.com/cameronbraid","followers_url":"https://api.github.com/users/cameronbraid/followers","following_url":"https://api.github.com/users/cameronbraid/following{/other_user}","gists_url":"https://api.github.com/users/cameronbraid/gists{/gist_id}","starred_url":"https://api.github.com/users/cameronbraid/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/cameronbraid/subscriptions","organizations_url":"https://api.github.com/users/cameronbraid/orgs","repos_url":"https://api.github.com/users/cameronbraid/repos","events_url":"https://api.github.com/users/cameronbraid/events{/privacy}","received_events_url":"https://api.github.com/users/cameronbraid/received_events","type":"User","site_admin":false},"labels":[],"state":"closed","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":0,"created_at":"2018-08-13T03:03:55Z","updated_at":"2018-08-13T20:41:54Z","closed_at":"2018-08-13T20:41:54Z","author_association":"CONTRIBUTOR","body":"I believe that the issue is because SpringRegistrator calls broker.createService after broker.start() is called, since when I manually configure the services before broker.start() they are exposed as expected.\r\n\r\nSpring Java :\r\n\r\n```\r\n@Bean(initMethod=\"start\", destroyMethod=\"stop\")\r\npublic ServiceBroker serviceBroker(ApplicationContext applicationContext) {\r\n\t\t\r\n\tServiceBroker broker = ServiceBroker.builder()\r\n\t\t.nodeID(Environment.getServerId())\r\n\t\t.transporter(new TcpTransporter())\r\n\t\t.build();\r\n\r\n\treturn broker;\r\n}\r\n\t\r\n@Bean\r\npublic SpringRegistrator springRegistrator() {\r\n\treturn new SpringRegistrator()\r\n}\r\n```\r\n\r\nI get log messages saying that the services are registered:\r\n\r\n```\r\n   38676 I s.m.service.DefaultServiceRegistry [main] Action \"nitro-compiled-code.put\" registered.\r\n   38677 I s.m.service.DefaultServiceRegistry [main] Action \"nitro-compiled-code.get\" registered.\r\n   38677 I s.m.service.DefaultServiceRegistry [main] Action \"nitro-compiled-code.clear\" registered.\r\n   38677 I s.m.service.DefaultServiceRegistry [main] Service \"nitro-compiled-code\" started with 3 actions.\r\n   38677 I s.moleculer.config.SpringRegistrator [main] Service \"nitro-compiled-code\" registered.\r\n   38677 I s.m.service.DefaultServiceRegistry [main] Action \"nitro-source-code.put\" registered.\r\n   38677 I s.m.service.DefaultServiceRegistry [main] Action \"nitro-source-code.get\" registered.\r\n   38677 I s.m.service.DefaultServiceRegistry [main] Action \"nitro-source-code.clear\" registered.\r\n   38677 I s.m.service.DefaultServiceRegistry [main] Action \"nitro-source-code.toBeCompiled\" registered.\r\n   38677 I s.m.service.DefaultServiceRegistry [main] Action \"nitro-source-code.updateLastAccessed\" registered.\r\n   38678 I s.m.service.DefaultServiceRegistry [main] Service \"nitro-source-code\" started with 5 actions.\r\n   38678 I s.moleculer.config.SpringRegistrator [main] Service \"nitro-source-code\" registered.\r\n```\r\n\r\nbut from repl they are not there  :\r\n\r\n```\r\nmol $ nodes\r\n╔═════════════════════╤══════════╤═════════════════════════════════╤════════╤══════════════════════════════════════════════════╤══════════╤═══════════════════════════╗\r\n║ Node ID             │ Services │                         Version │ Client │ IP                                               │    State │ CPU                       ║\r\n╟─────────────────────┼──────────┼─────────────────────────────────┼────────┼──────────────────────────────────────────────────┼──────────┼───────────────────────────╢\r\n║ lion                │ 0        │                           1.0.5 │ java   │ fe80:0:0:0:d4bf:2cff:fe9a:685%veth3c8fefb  (+14) │  ONLINE  │ [....................] 0% ║\r\n║ lion-44243764810535 │ 0        │                           1.0.5 │ java   │ fe80:0:0:0:d4bf:2cff:fe9a:685%veth3c8fefb  (+14) │  ONLINE  │ [....................] 0% ║\r\n║ lion-8905 (*)       │ 0        │ 0.13.1-DriveNow-RedisSentinel-4 │ nodejs │ 192.168.0.101  (+2)                              │  ONLINE  │ [■...................] 5% ║\r\n╚═════════════════════╧══════════╧═════════════════════════════════╧════════╧══════════════════════════════════════════════════╧══════════╧═══════════════════════════╝\r\n\r\nmol $ actions\r\n╔════════════════╤═══════╤══════════╤════════╤════════╗\r\n║ Action         │ Nodes │ State    │ Cached │ Params ║\r\n╟────────────────┼───────┼──────────┼────────┼────────╢\r\n║ $node.actions  │ (*) 3 │    OK    │   No   │        ║\r\n║ $node.events   │ (*) 3 │    OK    │   No   │        ║\r\n║ $node.health   │ (*) 3 │    OK    │   No   │        ║\r\n║ $node.list     │ (*) 3 │    OK    │   No   │        ║\r\n║ $node.options  │ (*) 1 │    OK    │  Yes   │        ║\r\n║ $node.services │ (*) 3 │    OK    │   No   │        ║\r\n╚════════════════╧═══════╧══════════╧════════╧════════╝\r\n\r\n```\r\n\r\nHowever If I manually do this (manually createService before broker.start()) :\r\n\r\n```\r\n@Bean(initMethod=\"start\", destroyMethod=\"stop\")\r\npublic ServiceBroker serviceBroker(ApplicationContext applicationContext) {\r\n\r\n\tServiceBroker broker = ServiceBroker.builder()\r\n\t\t.nodeID(Environment.getServerId())\r\n\t\t.transporter(transporter)\r\n\t\t.build();\r\n\r\n\tbroker.createService(applicationContext.getBean(NitroCompiledCodeService.class));\r\n\tbroker.createService(applicationContext.getBean(NitroSourceCodeService.class));\r\n}\r\n```\r\n\r\nThey are discoverable as expected :\r\n\r\n```\r\nmol $ actions\r\n╔══════════════════════════════════════╤═══════╤══════════╤════════╤═══════════════════════════════════════════════════════╗\r\n║ Action                               │ Nodes │ State    │ Cached │ Params                                                ║\r\n╟──────────────────────────────────────┼───────┼──────────┼────────┼───────────────────────────────────────────────────────╢\r\n║ $node.actions                        │ (*) 2 │    OK    │   No   │ onlyLocal, skipInternal, withEndpoints, onlyAvailable ║\r\n║ $node.events                         │ (*) 2 │    OK    │   No   │ onlyLocal, skipInternal, withEndpoints, onlyAvailable ║\r\n║ $node.health                         │ (*) 2 │    OK    │   No   │                                                       ║\r\n║ $node.list                           │ (*) 2 │    OK    │   No   │ withServices, onlyAvailable                           ║\r\n║ $node.options                        │ (*) 1 │    OK    │  Yes   │                                                       ║\r\n║ $node.services                       │ (*) 2 │    OK    │   No   │ onlyLocal, skipInternal, withActions, onlyAvailable   ║\r\n╟──────────────────────────────────────┼───────┼──────────┼────────┼───────────────────────────────────────────────────────╢\r\n║ nitro-compiled-code.clear            │     1 │    OK    │   No   │                                                       ║\r\n║ nitro-compiled-code.get              │     1 │    OK    │   No   │                                                       ║\r\n║ nitro-compiled-code.put              │     1 │    OK    │   No   │                                                       ║\r\n╟──────────────────────────────────────┼───────┼──────────┼────────┼───────────────────────────────────────────────────────╢\r\n║ nitro-source-code.clear              │     1 │    OK    │   No   │                                                       ║\r\n║ nitro-source-code.get                │     1 │    OK    │   No   │                                                       ║\r\n║ nitro-source-code.put                │     1 │    OK    │   No   │                                                       ║\r\n║ nitro-source-code.toBeCompiled       │     1 │    OK    │   No   │                                                       ║\r\n║ nitro-source-code.updateLastAccessed │     1 │    OK    │   No   │                                                       ║\r\n╚══════════════════════════════════════╧═══════╧══════════╧════════╧═══════════════════════════════════════════════════════╝\r\n```"},"comment":{"url":"https://api.github.com/repos/moleculer-java/moleculer-java/issues/comments/412656798","html_url":"https://github.com/moleculer-java/moleculer-java/issues/8#issuecomment-412656798","issue_url":"https://api.github.com/repos/moleculer-java/moleculer-java/issues/8","id":412656798,"node_id":"MDEyOklzc3VlQ29tbWVudDQxMjY1Njc5OA==","user":{"login":"berkesa","id":24964896,"node_id":"MDQ6VXNlcjI0OTY0ODk2","avatar_url":"https://avatars0.githubusercontent.com/u/24964896?v=4","gravatar_id":"","url":"https://api.github.com/users/berkesa","html_url":"https://github.com/berkesa","followers_url":"https://api.github.com/users/berkesa/followers","following_url":"https://api.github.com/users/berkesa/following{/other_user}","gists_url":"https://api.github.com/users/berkesa/gists{/gist_id}","starred_url":"https://api.github.com/users/berkesa/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/berkesa/subscriptions","organizations_url":"https://api.github.com/users/berkesa/orgs","repos_url":"https://api.github.com/users/berkesa/repos","events_url":"https://api.github.com/users/berkesa/events{/privacy}","received_events_url":"https://api.github.com/users/berkesa/received_events","type":"User","site_admin":false},"created_at":"2018-08-13T20:41:54Z","updated_at":"2018-08-13T20:41:54Z","author_association":"MEMBER","body":"Thans for the detailed report. The error was caused by the lack of a \"seq\" field from the node descriptor. This is a relatively new requirement, and transporter's implementation was out-of-date. It will be released to maven in some days. \r\n\r\nhttps://github.com/moleculer-java/moleculer-java/commit/d234827d2ecd4ab221ddb652b5526581ccbed03a#diff-0914bcf90070ed684bb567eec941da7fR702"}}
{"actor":{"display_login":"berkesa"}}