Comments (4)
这种就是你使用的方式有问题?
from jt808gateway.
QueueServer代码
var builder = WebApplication.CreateBuilder(args).Inject();
// 配置服务
builder.Services
.AddJT808Configure()
.AddWebApiClientTool(builder.Configuration)
.AddGateway(builder.Configuration)
.AddServerKafkaMsgProducer(builder.Configuration)
.AddServerKafkaMsgReplyConsumer(builder.Configuration)
.AddServerKafkaSessionProducer(builder.Configuration)
.AddTcp()
.AddUdp();
builder.Services.AddCors(options =>
options.AddPolicy("jt808", builder =>
builder.AllowAnyMethod()
.AllowAnyHeader()
.AllowCredentials()
.SetIsOriginAllowed(o => true)));
// 配置WebHost
builder.WebHost.ConfigureKestrel((context, options) =>
{
var jT808Configuration = context.Configuration.GetSection(nameof(JT808Configuration)).Get<JT808Configuration>();
options.ListenAnyIP(jT808Configuration.WebApiPort);
});
// 添加控制器
builder.Services.AddControllers().AddInject();
var app = builder.Build();
app.UseCors();
app.UseAuthorization();
app.UseInject();
app.MapControllers().RequireCors("jt808");
await app.RunAsync();
var builder = WebApplication.CreateBuilder(args).Inject();
QueueService代码
var builder = WebApplication.CreateBuilder(args).Inject();
// 配置服务
builder.Services.AddJT808Configure()
.AddClientKafka()
.AddMsgConsumer(builder.Configuration)
.AddMsgReplyProducer(builder.Configuration)
.AddSessionConsumer(builder.Configuration)
.AddReplyMessage<JT808QueueReplyMessageHandlerImpl>()
.AddSessionNotice<JT808SessionNoticeServiceImpl>();
builder.Services.AddRemoteRequest();
builder.Services.AddHostedService<SendCommandJob>();
builder.Services.AddHostedService<AlarmMessageConsumerJob>();
// 添加控制器
builder.Services.AddControllers().AddInject();
var app = builder.Build();
app.UseInject();
app.MapControllers();
await app.RunAsync();
请大佬帮忙分析下哪里有不对
from jt808gateway.
是QueueServer代码有问题还是QueueService代码有问题,这个看不出来喔,你可以用dotnet的dump分析下是哪个对象引起的。
from jt808gateway.
好的,谢谢大佬
from jt808gateway.
Related Issues (20)
- 运行找不到appsettings.json文件 HOT 4
- 基于core 3.1 Pipeline 这种方式客户端有测试的程序吗? HOT 1
- 有使用简单介绍说明么?
- HTML5中使用websocket怎么使用此网关进行数据同步 HOT 4
- Pipeline与DotNetty版本性能方面有差异吗? HOT 3
- Pipeline版本怎么集成LengthFieldBasedFrameDecoder协议? HOT 8
- 能否增加设备自定义协议处理方式? HOT 12
- Run in Ubuntu 18.04 arm64 error HOT 3
- IJT808MsgConsumer等接口OnMessage的元组参数问题 HOT 2
- 关于平台主动给设备下发指令 HOT 5
- 出现异常后无法继续接收并处理下个JT808包 HOT 2
- 有单独控制网关的start,stop功能吗 HOT 3
- StatusFlag 哪个状态是点火 哪个是熄火 HOT 2
- 运行JT808.Gateway.SimpleServer报错,不能连接127.0.0.1:20000 HOT 1
- 通过WebApi接口UnificationSend向设备发送消息后,拿不到设备返回的消息 HOT 1
- GPS 设备超过2台,Channel 会频繁断开,倒置GPS设备重新注册 、鉴权. HOT 1
- 压测发现tcp并发到1200时会出现延时了(网关添加kafka) HOT 1
- Docker 下报错,ubuntu 下运行也是这个错,我弄到 CentOS 没问题,但是 在CentOS 下 Docker 就报错 HOT 3
- SocketOptionName.NoDelay 设置 True 的时候 在Docker 运行会报错 HOT 4
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 jt808gateway.