Stream

Join this community to post or 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...
 
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...

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
Stefan Tsalapatis's profile photoPaula Moore's profile photoHenrik Larsson's profile photoGuillermo Andres Londoño's profile photo
14 comments
 
We use  ServiceStack in our software ,  in three  call centers, right now , 24/7,  to save 4000 support incidents per day.
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...

Herdy Handoko

Discussion  - 
 
Can anyone advise me if the ManageRoles service implementation has changed? e.g. assign and unassign roles. I updated SS from v4.0.21 to v4.0.34 and the role-related tests are failing.

It's now returning HttpError with the payload { "Invalid Role" }.

So far what I can see is that some parameters are not being passed on the check role method(s), will do a bit more investigation on my end, but any suggestion would be appreciated.

1
Demis Bellot's profile photoHerdy Handoko's profile photo
6 comments
 
Thanks Demis!
Add a comment...

Demis Bellot
owner

Announcements  - 
 
v4.0.34 Released!

We're happy to share a few new features added in this release:
https://github.com/ServiceStack/ServiceStack/blob/master/release-notes.md#v4034-release-notes

Add TypeScript Reference

TypeScript is the next language that's now able to benefit from having a typed API to consume your Services. The TypeScript Native Types feature takes a non-invasive approach in that they're made available in the form of a .d.ts TypeScript declaration file, where they can be used to annotate existing .js source code.

Auto Batched Requests

There are many times where Services would benefit from being able to batch multiple requests together, with Auto Batched Requests that's now possible where your existing ServiceStack Services now support batching without any additional effort! All .NET Service Clients now have this enabled with the new `SendAll` and `SendAllOneWay` API's.

ReactJS App Template

Following the modern approach to building Single Page Apps with the new AngularJS template, we've added a new flavour that supports developing React-based Apps as well. The new ReactJS App template enables optimal iterative dev experience without requiring any manual pre-compilation steps, whilst the included Grunt/Gulp build tasks takes care of packaging your app so it's optimized for production which can also be deployed with the built-in msbuild grunt task.

Redis 

 - Heartbeats are now enabled in RedisPubSubServer which will auto-reconnect when it detects a connection has silently dropped. (Should also improve the resilience in RedisMqServer and RedisServerEvents).

 - The new RedisManagerPool pooling behavior has been updated to create connections outside of the pool when max pool size has reached in contrast to PooledRedisClientManager which imposes a max connection limit and will throw if no connection becomes available within the configured PoolTimeout.

- The new `RedisRequestLogger` lets you store Request Logs Feature HTTP Requests in Redis so it will survive AppDomain restarts

OrmLite

 - OrmLite Self References supports multiple references of the same type by falling back to using property name conventions.

 - SqlExpression has a new API for Cross JOIN's

 - The new OpenDbConnectionString() API on DB Factory makes supporting multi tenant databases easier

Razor

 - New @Html.RenderAction("/products/1") lets you execute and include partials of different services with a populated url

- You can Render local or nested Content Partials in Content Pages, e.g @Html.Partial("SubDir/NestedParials")

AutoQuery

- AutoQuery supports multiple custom joins with `IJoin<T1,T2>` API

Other

 - RavenDbUserAuthRepository can be specialized to support custom UserAuth tables
 - New `RemoveSession()` and `GetSessionTimeToLive()` Session API's have been added

And more minor features, for more details please checkout the release notes: https://github.com/ServiceStack/ServiceStack/blob/master/release-notes.md#v4034-release-notes

Enjoy!
8
3
Stephen Patten's profile photoDarren Reid's profile photoAlexandru Vasile Pop's profile photoRiccardo D Errico's profile photo
5 comments
 
+Ryan Britton Agreed! Not only has he positioned us well on the client, but from what I gather from his conversations on twitter is that SS will be well positioned to run on the next versions of asp.net. Amazing how much work is poured into this product. 
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

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...
 
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...

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...
 
while doing some research on the back of the new React Chat example in 4.0.34, I came across quite a lot of comparisons between Angular and React, and quite a few places where the React virtual-Dom/diff management was used to offset Angular's poor performance.

Flux on-top of React seems like a very solid "design pattern" for high-performance data/event management; but since it flies in the face of 2-way data binding, I assume that once you start following the Dispatcher/Store model you would start to feel that the benefits of Angular were being "boxed".

This is all conjecture at this point - I was just wondering what everyone else's opinion was - since everyone will inevitably come to the point where they would need to make a design decision regarding the "flavour" of JavaScript client to connect to their ServiceStack...

+Demis Bellot : do you have any opinions you could share regarding this?
1
Demis Bellot's profile photoRyan Britton's profile photo
2 comments
 
awesome! Thanks for the lengthy reply, sir :-) 

I think that if heavy-load applications like Facebook and Instagram are successfully using React in production then its a pretty safe bet....and it does seem to fit in with your development ethos for SS....simple, functional and fast....
Add a comment...
 
The last time we setup an auth system to use servicestack's was 3.9.71; one of the things we had to heavily customize was the repo because we can't force emails to be unique per account.

Has that been changed in 4.x, or is there still an assert that both email and username are unique (username uniqueness is all we can enforce)?
1
Jeffrey Sullivan's profile photoDemis Bellot's profile photo
4 comments
 
Right, it just needs either a Username OR an Email, so Email isn't required when you have a Username.
Add a comment...