Giter Site home page Giter Site logo

streamo's Introduction

Project Description

Listening to Exchange Streaming Notifications in a simple way.

Streaming notifications in Exchange (starting with 2010 SP1) combine the functionalities of push and pull notifications without having to set up a dedicated web service to receive the Exchange events. The client opens a long-standing call to EWS which is being used to receive real time notifications. StreamO aims to simplify Streaming Notification Subscriptions for many mailboxes and was created with Office 365 in mind.

##Requirements##

You need a service account for your Exchange environment with permissions to impersonate the targeted users. See http://msdn.microsoft.com/en-us/library/exchange/bb204095(v=exchg.140).aspx

Also, Autodiscover is a must.

##Sample usage## //Multiple long standing EWS calls might cause problems with the DefaultConnectionLimit ServicePointManager.DefaultConnectionLimit = 10;

        ExchangeCredentials cred = new WebCredentials("[email protected]", "password");
        using (var listener = new StreamingListener(cred, (eventData) =>
            {
                Console.WriteLine("Receiving events for {0}", eventData.Sender.ToString());
                foreach (var e in eventData.Events)
                {
                    Console.WriteLine(e.EventType.ToString());
                }
            }))
        {
            //default: listen to NewMail events in the inbox
            listener.AddSubscription("florian.hoetzinger@yourdomain");
            
            //listen to Created events in the Contacts folder 
            listener.AddSubscription("[email protected]",
                new List<FolderId> { WellKnownFolderName.Contacts },
                new List<EventType> { EventType.Created });

            Console.WriteLine("Listening...");
            Console.ReadLine();
        }

##nuget## StreamO is available on [nuget] (https://nuget.org/packages/StreamO/)

##scriptcs## StreamO works just fine with the latest [scriptcs] (https://github.com/scriptcs/scriptcs) release.

        scriptcs -install StreamO
        scriptcs
        > using StreamO;
        > using Microsoft.Exchange.WebServices.Data;
        > var cred = new WebCredentials("[email protected]","password");
        > var listener=new StreamingListener(cred,(eventData)=>{ Console.WriteLine("Event incoming for "+eventData.Sender.ToString());  });
        > listener.AddSubscription("[email protected]");

streamo's People

Contributors

hoetz avatar

Stargazers

Kasper Frank avatar

Watchers

James Cloos avatar Mikael Ribeiro avatar  avatar

Forkers

itadder

streamo's Issues

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.