php-eureka
php-eureka copied to clipboard
How to make always send heartbeat with run application?
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
Hi.
What do you mean by "the application is not running"?
The start()
method should only be invoked from the command line (php cli).
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!!
You can create a console command in Laravel and put the codes there, as described in the documents of php-eureka.
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();
}