Comments (8)
把你代码贴一下看看.
from laravel-nsq.
Controller
// the data you want to be publish
$str = [
'id' => 1,
'userId' => 2,
'type' => 4,
'price' => 7,
'amount' => 8,
'takerFee' => 10,
'makerFee' => 11,
'source' => 12,
];
Queue::connection('nsq')->push(new EntrustTransactionsJob(), $str);
EntrustTransactionsJob
/**
* @var int 任务运行的超时时间
*/
public $timeout = 120;
/**
* @var string
*/
public $topic = 'test';
/**
* @var string
*/
public $channel = 'web';
/**
* Create a new job instance.
*
* @return void
*/
public function __construct()
{
}
/**
* Execute the job.
*
* @return void
*/
public function handle()
{
$client = $this->job->getCurrentClient();
$payload = json_decode($this->job->getMessage(), true);
}
from laravel-nsq.
EntrustTransactionsJob 这个job类的 $topic 属性有设置吗
from laravel-nsq.
有的,刚刚贴错了,已经更新了,麻烦再帮忙看下
from laravel-nsq.
看起来像是nsq服务端没有publish成功,Errors were: 这后面没有更详细的错误信息吗? 还有把你.env 配置的nsqd地址发下, 或者你可以用 curl -d "<test msg>" http://127.0.0.1:4151/pub?topic=test 命令看看响应什么
from laravel-nsq.
laravel 报错:
from laravel-nsq.
配错了哦, NSQSD_URL=xxxx:4150 publish是走tcp协议的,所以要配4150端口,4151是http协议的,建议看下文档哦
from laravel-nsq.
好的,已经可以了,Nsq也是第一次接触不太熟悉,十分感谢哈
from laravel-nsq.
Related Issues (3)
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from laravel-nsq.