servicestack

ServiceStack CRUD Service routing Documentation

扶醉桌前 提交于 2021-02-19 07:08:25
问题 I am unable to find documentation (Clear or otherwise) that explains how to implement a Service in Service Stack with multiple methods. All examples show a service class with one method only. I cant imagine if you have a service with 4+ methods, that your really need to make 4+ service classes, 4+ Request DTO's and 4+ response DTO's. ( As shown here ) Example: A Service with 4 Search methods ( method(Identifer1), method2(identifer2), method3(identifer3)) Based on the documented structure of a

ServiceStack OnDeserialized Equivalent

对着背影说爱祢 提交于 2021-02-19 06:16:48
问题 I am deserialize a websocket message in real time. In the message (string of json) I receive there is a unix timestamp (long). As soon as each object is deserialized I need it to call a method ASAP so that I can capture the delay between the time the message was sent and received. With Json.NET that was simple I just added this method to my DataContract class: [OnDeserialized] private void OnDeserialized(StreamingContext context) { Timestamp = DateTimeOffset.FromUnixTimeMilliseconds

Servicestack ormlite window functions

余生颓废 提交于 2021-02-11 15:19:43
问题 I am using version 4.5.14 of Servicestack ormlite Following are my domain classes public class Network { [PrimaryKey] public string Id { get; set; } public string Name { get; set; } [CustomSelect("NULL")] public bool? InMaintenance { get; set; } } public class NetworkMain { [PrimaryKey] public string Id { get; set; } [ForeignKey(typeof(Network))] public string NetworkId { get; set; } public DateTime? EndDate { get; set; } } 1 network may have 1 or NetworkMain records. here InMaintenance is

ServiceStack Messaging API: Can it make a broadcast?

南楼画角 提交于 2021-02-10 15:45:46
问题 As I have previously mentioned, I am using ServiceStack Messaging API ( IMessageQueueClient.Publish ) as well as the more low-level IRedisClient.PublishMessage . I use the Messaging API when I need a specific message/request to be processed by only one instance of a module/service, so even though I might have several modules running that all listens for MyRequest , only one service receives the message and processes it. I use the IRedisClient.PublishMessage when I do a broadcast, a pub/sub

ServiceStack Messaging API: Can it make a broadcast?

我的梦境 提交于 2021-02-10 15:44:23
问题 As I have previously mentioned, I am using ServiceStack Messaging API ( IMessageQueueClient.Publish ) as well as the more low-level IRedisClient.PublishMessage . I use the Messaging API when I need a specific message/request to be processed by only one instance of a module/service, so even though I might have several modules running that all listens for MyRequest , only one service receives the message and processes it. I use the IRedisClient.PublishMessage when I do a broadcast, a pub/sub

NLog with Application Insights - logging exceptions as an exception instead of a trace

允我心安 提交于 2021-02-10 11:44:26
问题 Currently I am using a .NET Core Web Application built using Service Stack. Logging is currently provided by using NLog, with Azure Application Insights as a target. Currently when I log messages and exceptions, I am coming across some weird behaviours: Log.Fatal("test not implemented exception", new NotImplementedException()); //this logs under Exceptions in Application Insights Log.Fatal(new NotImplementedException("test not implemented exception")); //this logs under Trace What I would

ServiceStack: async/await service handlers

纵然是瞬间 提交于 2021-02-10 07:25:21
问题 I have read a few SO questions that touches in this question, even though many of them are several years old: How do you write a Service handler in ServiceStack API so that it becomes async/await? There are no docs on docs.servicestack.net that mentions async/await at all, I just find some community forum posts. I think that the only thing you need to do, to change this non-async method: public GetBookingResponse Get(GetBooking getBooking) { Booking booking = _objectGetter.GetBooking

.NET微服务架构及API网关

☆樱花仙子☆ 提交于 2021-02-07 00:40:10
一、MSA简介 1.1、MSA是什么 微服务架构MSA是Microservice Architecture的简称,它是一种架构模式,它提倡将单一应用程序划分成一组小的服务,服务之间互相通讯、互相配合,为用户提供最终价值。 它与SOA之间的区别如下: SOA实现 微服务架构实现 企业级,自顶向下开展实施 团队级,自底向上开展实施 粒度大:服务由多个子系统组成 粒度细:一个系统被拆分成多个服务,且服务的定义更加清晰 重ESB:企业服务总线,集中式的服务架构 轻网关:无集中式总线,松散的服务架构 开发过程复杂 易开发:减少了企业ESB开发的复杂性,与敏捷开发的思想高度结合在一起 单块架构系统,相互依赖,部署复杂 服务能被独立部署 1.2、我们的MSA框架 我们的 微服务框架MsaFx.dll 是个基于ServiceStack 4.0.60包装实现的.NET Web Services框架,而ServiceStack本身支持通用的轻量级协议和Metadata。 MsaFx 与普通 Web S ervices框架如WCF相比,主要优势如下 : 1、 高性能: 性能好、速度快。 2、 支持跨平台运行: 基于M saFx 开发出的Web Services既能够运行在Windows环境中,又能够运行在支持Mono的Linux环境中。 3、 支持多协议: 如 JSON格式的也支持XSD。 4、

Seeking an understanding of ServiceStack.Redis: IRedisClient.PublishMessage vs IMessageQueueClient.Publish

久未见 提交于 2021-01-29 19:43:17
问题 I am having a hard time separating the IRedisClient.PublishMessage and IMessageQueueClient.Publish and realize I must be mixing something up. ServiceStack gives us the option to listen for pub/sub broadcasts like this: static IRedisSubscription _subscription; static IRedisClient redisClientSub; static int received = 0; static void ReadFromQueue() { redisClientSub = redisClientManager.GetClient(); _subscription = redisClientSub.CreateSubscription(); _subscription.OnMessage = (channel, msg) =>

ServiceStack.Mq: Why isn't the IRedisSubscription.OnMessage fired when manually adding data to the channel?

一笑奈何 提交于 2021-01-29 05:43:16
问题 I am using ServiceStack and the IRedisSubscriber. I have gotten it to work, triggering the OnMessage. However, sometimes it does not trigger, and I am trying to figure out why. The basic setup is: RedisClientManager = new PooledRedisClientManager("localhost:6379"); _mqServer = new RedisMqServer(RedisClientManager, retryCount: 2) { RequestFilter = RequestFilter }; _mqServer.Start(); //Starts listening for messages In a separate class, I have: public MqChannelSubscriber(string eventChannelName,