Skip to content

Commit 05c64ef

Browse files
committed
增加Produce重载,支持引入AntWeb的项目直接发布消息
1 parent 1027b4d commit 05c64ef

1 file changed

Lines changed: 16 additions & 0 deletions

File tree

AntJob.Server/Services/JobService.cs

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -429,6 +429,22 @@ public Int32 Produce(App app, ProduceModel model)
429429

430430
return total;
431431
}
432+
433+
/// <summary>生产消息</summary>
434+
public Int32 Produce(String appId, String topic, String[] messages)
435+
{
436+
var app = App.FindByName("Route.Gbm");
437+
if (app == null || !app.Enable) throw new XException("应用未启用");
438+
439+
var model = new ProduceModel
440+
{
441+
AppId = appId,
442+
Topic = topic,
443+
Messages = messages
444+
};
445+
446+
return Produce(app, model);
447+
}
432448
#endregion
433449

434450
#region 状态报告

0 commit comments

Comments
 (0)