Stream

Join this community to post or comment
 
I posted this question on SO. Any input/experience in this regard would be appreciated....
1
Ryan Britton's profile photoBlake Blackshear's profile photo
5 comments
 
We are going to run with mono as a self host daemon in production anyways. I hate managing Windows servers. I think our load is small enough. The load testing will let us know.
Add a comment...

Michael Daly

Discussion  - 
 
It's been asked before that SS.Text serialise private set properties (which goes against DTO principals). Can a view be taken (it's already being marketed like this) that SS.Text is more general purpose than DTO serialisation i.e. make serialising private set properties configurable?

Additionally, when an object is IEnumerable<T>, the only thing that gets serialised is the enumerable, properties on the object implementing IEnumerable<T> are ignored, can this be made configurable too?
1
Michael Daly's profile photoDemis Bellot's profile photo
3 comments
 
As a rule the serialized JSON matches the shape of the type its serializing/deserializing. Trying to co-erce it into a different and non-standard shape like this is the kind of approach that's fragile, causes confusion, breaks in other serializers and introduces unnecessary complexity. One of the reasons why JSON is so successful is because it's simple and supports a small subset of types that's a perfect programmatic fit for most type systems and why your DTO's should be designed to fit it, not fight against it.
Add a comment...

Ryan Britton

Discussion  - 
 
I see that in the latest version of SS (.38) you're starting to play around with using a SS deployment to double as a proxy? I would be keen to hear your motivations behind this? 

my thoughts (with apologies in advance - because they are a little broad and generalised):

I've been thinking about a strategy for using SS deployments as a distributed system of atomised worker nodes for a freight customer who needs to enable dozens of offline-capable sites with poor connectivity  spread around the country, and the thinking around using SS as a "network device" seems to support a move in this direction.

I can see dozens of touch-points which would make SS the ideal tool for the job here. IMO the difficulties would be in master-master-type synchronisation of data, and in the management worker queues (MQ) in these types of scenarios (which would be difficult when using something like redis to house the queues, while still maintaining a centralised view of things like dead-letter queues etc).

Do you think it would be worthwhile to build an MQ module for SS using 0MQ (where the focus is less about a deferred storage of message on-disk and in memory and more about individual workers with intelligent retry-mechanisms communicating directly, and the efficiency of raw network communication between these nodes using an established set of architectural patterns)?

add in some SS-node "discovery", and you've got something ~really~ interesting... what do you think?

http://zguide.zeromq.org/page:all
By Pieter Hintjens, CEO of iMatix. Please use the issue tracker for all comments and errata. This version covers the latest previous stable release of ØMQ (3.2). If you are using older versions of ØMQ then some of the examples and explanations won't be accurate.
1
Demis Bellot's profile photoRyan Britton's profile photo
2 comments
 
thanks for the feedback - I've heard of nonomsg previously, but never really had a good look. I didn't realise that Peter was behind it.

Yeah - in 0MQ software patterns like "The Paranoid Pirate" and "The Titanic" were recommended for these retry mechanisms (the latter which also "persists to rusty platters at the expense of performance", as he puts it)

I was thinking of using something like an embedded RavenDb database for persistence ONLY if sending fails. I know that purists would talk about the risk of the process failing while messages are within the retry-loop - I guess it boils down to how much performance you're willing to sacrifice in the interests of redundancy.

I've seen an enterprise solution with clustered MSMQ services fall over despite a huge price-tag to purchase "foolproof redundancy")...
Add a comment...
 
Can I query across databases with ORMLite.SqlServer? If i have a query that requires Dba.dbo.Tablea inner joined with Dbb.dbo.Tableb is that possible? I don't see anything in the documentation about specifying the database name in the class
1
Demis Bellot's profile photoBrandon Nelson's profile photo
4 comments
 
Using scheme like that worked thanks
Add a comment...
 
Trying to minimize CSS en JS on the fly. After the HTML minification (last post, works like a charm) I would like to auto-minimize css and js files too. Any ideas on how to accomplish this?
1
Demis Bellot's profile photoRob Schoenaker's profile photo
11 comments
 
Hmmm I zee where you are heading now. In that case it is quite impossible tot know the exact state while processing.... Bummer.
Add a comment...
 
Is the 250/dev ORMLite license a yearly license (for usage, not support) or a perpetual license like servicestack main? Will ORMLite work stand alone? Can it be used with things like Web API 2?
1
Demis Bellot's profile photo
 
Yep it's perpetual like ServiceStack where you can continue to use the last version before your 12 months maintenance expires without renewing. It's also a stand-alone product and can be used outside of ServiceStack.
Add a comment...

Bruce Parr

Discussion  - 
 
Hey Demis, has there been any thought given toward an evangelism program? I have seen posts asking you to visit xyz to present, but as much as we would love to see your smiling face, you can't be everywhere at once. 

Personally I feel comfortable enough with the community version to present basics, but if there was a "how to present" or similar, I would love to be a local evangelist here in Pittsburgh, PA. As it is now, our local ASP.NET MVC Meetup group is thinking about an "API Cage Match" presentation with me using SS and another dev using Web API at the same time to develop a common set of tasks, but having an evangelism guide to make it "official" would be awesome. 

If this hasn't been discussed or otherwise does not (yet) exist, I'd love to be a part of it.

Thoughts or comments are appreciated. 
1
Demis Bellot's profile photoJoe Kuemerle's profile photo
2 comments
 
I recently did a talk at my local user group "Hey, You Got Your API In My Website!" ( http://www.kuemerle.com/talks/servicestack/ ) that was well received.The code that I use as a basis for that talk is: https://github.com/jkuemerle/DoorComp .

I am also shopping that talk around to various conference but nobody has yet picked it up. I now know who to talk to if it get accepted and I want some swag to give away.

I am also open to feedback on my abstract if anyone has any suggestions for way to improve it.
Add a comment...

Yasir Khan

Discussion  - 
 
What is the future of ServiceStack. Is there anyone using it in production except Stack Overflow? My company will be making an important decision regarding our new REST API platform and I want to know if this platform is production ready.
3
3
Rob Schoenaker's profile photoPaula Moore's profile photoHenrik Larsson's profile photoGuillermo Andres Londoño's profile photo
15 comments
 
A bit late response maybe, but anyway.
We have been using SS since version 3.9. It serves as a cleanly separated infrastructure. We chose SS because of the lightweight and easy implementation, easy IoC, no extra dependencies and cross-platform availability.

We have some old MVC apps running as well, but they are slow compared to SS. Especially startup on MVC is slow.

If you are in the Netherlands and like to do some rhyming, check out Van Dale's rijmservice on: www.vandale.nl/rijmwoordenboek

This is 100% ServiceStack + a custom rhyming engine. It includes the latest version that also does HTML, JS and CSS compression. 
Add a comment...

Demis Bellot
owner

Announcements  - 
 
v4.0.36 Released!

https://github.com/ServiceStack/ServiceStack/blob/master/docs/2015/release-notes.md

Xamarin Unified API
It's another short release cycle this time around as we wanted to ship the ServiceClients new support of Xamarin Unified API to Xamarin developers as soon as possible.

Add ServiceStack Reference meets Xamarin Studio
In this release we've also released our initial ServiceStackXS Add-In for Xamarin which provides Add ServiceStack Reference support to Xamarin Studio! This should improve the development experience for Mobile App Developers building Apps with Xamarin Studio to Consume your Services.

SitemapsFeature
There's a new Sitemap plugin that makes it easy to generate dynamic Sitemap of your website routes to help Search Engines into properly indexing your website

TechStacks LiveDemo Features
I've also gone through some of the features added in techstacks.io LiveDemo that may be useful to know. Which shows how to generate multiple versions of your Website and code required to make Twitter Status updates from your website (and other Twitter Authorized API requests).

There's a couple of other minor features, check the release notes for all the details:
https://github.com/ServiceStack/ServiceStack/blob/master/docs/2015/release-notes.md

Enjoy!
Demis
8
3
Demis Bellot's profile photoDarren Reid's profile photoHenrik Larsson's profile photoStephen Brannan's profile photo
6 comments
 
+Steven Song No, that's only with the AGPL/FOSS License that's on the public GitHub repositories. The commercial license is what permits the usage of ServiceStack in closed source applications.
Add a comment...

Demis Bellot
owner

Announcements  - 
 
Happy New Year All!

v4.0.35 was published yesterday to finish off the year, it was a fairly short release cycle with a number of minor changes, fixes and polishes I wanted to release before everyone got back to work in 2015: https://github.com/ServiceStack/ServiceStack/blob/master/release-notes.md#v4035-release-notes

A couple noteworthy announcements in this release is the new http://techstacks.io website built with the modern ServiceStackVS AngularJS App VS.NET Template.

New TechStacks LiveDemo
techstacks.io lets you explore Technology Choices for popular StartUps and view who else is using your favorite technologies. We've added a number of the most popular StartUps and would welcome anyone else adding their own Technology Stacks or know of TechStacks for any companies we've missed. 

ServerEvents now supports Multiple Channels per subscription
Basically this allows ServerEvents Clients to listen for events on multiple channels with a single subscription. With this feature we've now been able to add Multiple Chat Rooms to both Chat and React Chat, e.g: react-chat.servicestack.net/?channels=home,work,play

All jQuery Chat, React Chat and ServiceStack.Gap Chat Apps were upgraded to support multiple chat rooms, each requiring very little code/effort.

There were also a number of minor changes/fixes, please check out the Release Notes for more info: 
https://github.com/ServiceStack/ServiceStack/blob/master/release-notes.md#v4035-release-notes

Hope everyone gets off to a great start in 2015!
7
Add a comment...

About this community

ServiceStack is a services framework providing a simpler alternative to WCF, MVC and WebApi, with Web, REST, SOAP and MQ services for .NET or Mono. This group lets you get in touch with the wider ServiceStack community and share relevant news, announcements and discussion. To keep things relevant to members, and for this group to retain a high quality ratio of meaningful and interesting content - please keep all support questions on StackOverflow or inside Customer Forums. Customer support options are available at: https://servicestack.net/account/support

Brett Nagy

Discussion  - 
 
Today I had to work on a project for a client and due to restrictions out of my control, that project had to be ASP.NET MVC 5. Today I was reminded what a ball of mess that world is.

There's no definitive answer on how to use Ninject with MVC and WebAPI (err, 2 frameworks in one right there), DLL versioning nightmares where MVC 4 still creeps in and bin deploy craziness that's not documented anywhere.

So, ServiceStack people, thank you. Thank you for doing what you're doing.
18
Demis Bellot's profile photo
 
Thanks, after years of being a slave to them, I've long ago abandoned considering MS frameworks and their constant rewrite cycles (and as a result was close to abandoning C#/.NET entirely). IMO MS fx's don't have the right focus on simplicity, optimizing for end value, re-use and thinking how everything fits/integrates together and IMO seem to constantly come up with large, over-architected, disjointed and complicated slns for relatively basic use-cases. E.g. the number and size of dependencies for some of the starting templates are frightening. Most of the time it's hard to tell what dlls/deps and config are required so a lot of the time you'll end up deploying ~50+ deps and heavy config for even basic projects. In contrast you can get pretty far with just SS core dlls, e.g: https://github.com/ServiceStackApps/Chat#super-lean-front-and-back which also allows for some use-cases like embedding and ilmerging them all together: https://github.com/ServiceStack/ServiceStack.Gap which isn't something I'd attempt with any of MS's heavy fx's.

One of the goals of Simplicity should be to start from a good solid design that maximizes re-use and continue to strengthen/enhance its mental model to maximize value and reduce the cognitive load required to Get Things Done with minimal effort/friction required - IMO this hasn't historically been a goal, hence the reason for starting SS. Although it is nice that C# has had great language designers that's avoided adding unnecessary bloatware and has remained a well-designed modern language that IMO is still the best general purpose statically typed language to date (tho does have its warts) - just a shame the same careful thought and talent weren't available for ASP .NET and MS's default high-level fx's which were clearly designed and written by other devs with different focuses.
Add a comment...

Demis Bellot
owner

Announcements  - 
 
AutoQuery Viewer Released!

Hi everyone, just a quick note to announce that our new AutoQuery Viewer iPad app is now available for free download on the AppStore :) https://github.com/ServiceStackApps/AutoQueryViewer

AutoQuery Viewer lets you query your AutoQuery Services from a native iPad App. It's also highly customizable so you can tailor it to provide a unique experience for your Services.

Full details of the customization available and examples are available in the GitHub project repo: 
https://github.com/ServiceStackApps/AutoQueryViewer

Feedback is Welcome!
AutoQueryViewer - Native iPad App for browsing, inspecting and querying any ServiceStack AutoQuery Service
4
1
Darren Reid's profile photo
Add a comment...

Demis Bellot
owner

Announcements  - 
 
v4.0.38 Released!
https://servicestack.net/release-notes

Swift!
We're excited to announce our new support for Apple's new Swift Programming language in this release to provide the most productive way to consume typed web services from iOS and OSX Apps!

If you've previously used *Add ServiceStack Reference* for .NET or TypeScript projects you'll feel instantly familiar with the new solution for Swift iOS and OSX projects which includes an XCode Plugin that provides the Add Reference Dialog from XCode. After adding the url to the remote ServiceStack instance, the generated Swift DTO's are added to your project with the filename specified as well as a JsonServiceClient.swift file (aka JSC from ServiceStack.Client NuGet pkg) which encapsulates a typed JsonServiceClient with API's based from the .NET JsonServiceClient.

TechStacks App
To illustrate how nice the new Swift support is we've developed a native iOS App for techstacks.io and go through some of techniques we used to build a responsive, non-blocking iOS App. 

TechStacks Desktop App
We've also developed an OSX Desktop App which is built around 2 simple AutoQuery Services showing how much querying functionality AutoQuery provides for free as well as how easy it is to call from Swift.

Built-in HTML/JS/CSS Minification
If you don't already have a built-in minification solution for your project this is an really easy and non-invasive solution to easily enable for an existing solution. It can be enabled for dynamic Razor views on the RazorFormat plugin and we also include an elegant solution using Virtual File System to pre-populate your ServiceStack instance on StartUp with minified css/js/html files.

New ServiceStack Cookbook
There's a new ServiceStack Cookbook by +Kyle Hodgson and +Darren Reid  showing 70 real-world recipies taking advantage of some of the neat features in ServiceStack.

Support for Bing's new RecycableMemoryStream
We've added support for switching to use Bing's new RecycableMemoryStream which is designed around re-using a pool of byte buffers.

Authentication
There is a new Microsoft Live OAuth2 Provider contributed by +Ivan Fioravanti 
and a new Instagram OAuth2 Provider contributed by Ricardo Brando

New url redirect filters enabled in all AuthProviders letting you inspect and customize the redirect urls sent by each AuthProvider.

There's also a few other minor features - please check the Release Notes for more details! https://servicestack.net/release-notes

Enjoy!
7
1
Demis Bellot's profile photoTobias Zürcher's profile photoDarren Reid's profile photo
3 comments
 
totally see your point. we started with swift a new project, but moved back to obj-c :) that's why i was asking. keep it up!
Add a comment...
 
I am seeing an issue with XML request deserialization when a charset is specified as part of the Content-Type. When the Content-Type header is specified as "text/xml; charset=utf-8" with a space between content type and charset and utf is lowercase, the request object is being deserialized to null. Removing the space between before charset or capitalizing utf allows the request to be properly deserialized. Is there something in the parsing that is causing this? I am able to reproduce by creating a DTO with a single property and trying to POST the request with the associated content-type in fiddler. I am unable to reproduce in postman as it apparently silently capitalizes UTF.

Successful headers
Content-Type: text/xml; charset=UTF-8 (capital UTF)
Content-Type: text/xml;charset=utf-8 (no space)
Failure headers
Content-Type: text/xml; charset=utf-8 (lowercase utf, space)
2
Demis Bellot's profile photo
4 comments
 
FYI this was resolved in this issue: https://github.com/ServiceStack/Issues/issues/237 - fix is available on MyGet.
Add a comment...

Rob Schoenaker

Discussion  - 
 
I was testing some functionaity for automatically minimizing Razor ViewPages. The code is quite simple and it seems stable. Here is the suggested modification:


Modifications to public abstract class RenderingPage:

1. Add a static field:
 public static bool MinimizeOuput = false;

2. modify the WriteLiteral method to this:

//No HTML encoding
    private char lastChar = (char)0;
    public virtual void WriteLiteral(string str)
    {
      if (MinimizeOuput)
      {
        char c;
        for (int i = 0; i < str.Length; i++)
        {
          c = str[i];
          if (c < 32) continue; // Skip all these
          if (c == 32)
          {
            if (lastChar == 32) { continue; } // Only write one space character
          }
          this.Output.Write(c);
          lastChar = c;
        }
        return;
      }
      // Non minimized version
      this.Output.Write(str);
    }

3. In AppHost.Configure, enable or diable this with:
RenderingPage.MinimizeOuput = true / false;

Any ideas?
1
Demis Bellot's profile photoRob Schoenaker's profile photo
31 comments
 
The HTML compressor is more difficult. It needs to take the JavaScript into account. I will fix that too
Add a comment...

Liang Qin

Discussion  - 
 
OrmLite is such a great ORM!
5
Add a comment...
 
Is there a way to use async with servicestack? I can't find any examples of that in the documentation.
1
Demis Bellot's profile photoTim Goyer's profile photo
2 comments
 
I have one slight quibble with your async example.  It's best practice to use Task.Run instead of Task.Factory.StartNew.  While Task.Run is more or less shorthand for Task.Factory.StartNew, there are specific examples where they don't behave the same.

For instance,  a blog post by Stephen Toub (http://blogs.msdn.com/b/pfxteam/archive/2011/10/24/10229468.aspx) talks about what to expect from Task.Run. Specially in the scenario where the action returns Task<TResult>, Task.Factory.StartNew would return a Task<Task<TResult>> requiring an Unwrap to get the inner task where as Task.Run would return a Task<TResult> with an implicit unwrap.
Add a comment...

Scott Peterson

Discussion  - 
 
We are looking at creating services and having them consumed by a thin client built on the react-starterify template which uses ReactJS and is built using Gulp.  I have been following ServiceStack for awhile, and came across the ReactChat example.  While it's nice that there's a sample with React, I'm not sure how much I like having Razor involved.  Is there a way to make the separation between client and server cleaner?
1
Darren Reid's profile photoScott Peterson's profile photo
6 comments
 
Thank you very much!  I'll check this out.
Add a comment...
 
I hope I'm not exposing myself for total ridicule here, but I couldn't find any way for OrmLite to automatically update the DB schema from model changes. I made this: https://github.com/contradel/Extending-NServiceKit.OrmLite

Atm. it only works with MySql, but an interface implementation should get it to work with other databases. Also testing requires access to a MySql db.
Testing would be:
 - clone, open in VS, give it a connection string to a MySql database
(preferable an empty local one), change the predefined models, run.

"Unit" tests cover 86% atm. I'm not mocking the database.

Could it in any way be used by others?
Extending-NServiceKit.OrmLite - Read more here https://github.com/NServiceKit/NServiceKit.OrmLite
1
Ethan Hann's profile photoHerdy Handoko's profile photo
3 comments
 
I am using FluentMigrator as well, +Ethan Hann​. Although at the moment it's just a thin wrapper to run the prepared SQL script.

I thought this might be a good complement so I don't have to maintain model code from existing schema.
Add a comment...

Jason He

Discussion  - 
 
Hi Demis.

I have a question for latest LiveDemo TechStacks. The way you handle HTML5 mode doesn't seems elegant solution. 

All NotFound http error redirect to a default page isn't going to solve problem but introduce errors.

For example by hitting "http://techstacks.io/techstacks/test" it will return default page instead of not found error for RESTful request. 

That approach cannot resolve multiple single page application either. 

A better approach shouldn't be a ServiceModel that have special routing parameter? For example: [Route("/singleApp1/{{ignore}}")], [Route("/singleApp2/{{ignore}}")]. The route module handing all the hard work. 
1
Jason He's profile photoDemis Bellot's profile photo
5 comments
 
FYI I've modified TechStacks to use a FallbackRoute in this commit: https://github.com/ServiceStackApps/TechStacks/commit/6c9e17f4c4d8cb897f60eb7a915f8bbc86267f0f

So this now returns 404 for HTML Requests that throw 404 errors, e.g: http://techstacks.io/techstacks/-1

Unfortunately this change needs v4.0.36 of SS on MyGet because I just added support of referencing Razor Content Pages (e.g. /default.cshtml) in `HttpResult.View`. I could've refactored TechStacks to use Razor Views and split default.cshtml into `/Views/Shared/_Layout.cshtml` and `/Views/*.cshtml` etc, instead but IMO it's better for SPA's to stick with a single /default.cshtml and only add the additional boilerplate of MVC-style Razor Views when necessary.
Add a comment...