php-eureka icon indicating copy to clipboard operation
php-eureka copied to clipboard

How to make always send heartbeat with run application?

Open AlfaIrawan opened this issue 5 years ago • 4 comments

Hello,

Im trying to send heartbeat like this

try { $client->register(); $url = $client->fetchInstance("test")->homePageUrl; var_dump($url); $client->start(); }

Yes its working but the application not running. Any guide how to send heartbeat with running application?

Best Regards, Alfa

AlfaIrawan avatar Aug 29 '19 00:08 AlfaIrawan

Hi. What do you mean by "the application is not running"? The start() method should only be invoked from the command line (php cli).

piwvh avatar Oct 23 '19 07:10 piwvh

Hello! I am trying to add laravel to Eureka Client . Where should I Put your codes? PLease can you send full source code of your app for Eureka client!!

sanzharanarbay avatar Jan 10 '20 03:01 sanzharanarbay

You can create a console command in Laravel and put the codes there, as described in the documents of php-eureka.

piwvh avatar Jan 10 '20 11:01 piwvh

Hello! I have error!!! Please help!!! GuzzleHttp\Exception\ClientException : Client error: POST http://10.100.0.7:8080/eureka/apps/NewsService resulted in a 404 Not Found response

public function handle() { $client = new EurekaClient([ 'eurekaDefaultUrl' => 'http://10.100.0.7:8080/eureka-server/eureka', 'hostName' => 'NewsService', 'appName' => 'NewsService', 'ip' => '10.111.2.23', 'port' => ['8000', true], ]);

        $client->register();
        $client->start();



}

sanzharanarbay avatar Jan 16 '20 09:01 sanzharanarbay