notify your windows store app with service bus notification hub

29
Template designed by notify you app Fabio Cozzolino [email protected] http://dotnetside.org/blogs/fabio @fabiocozzolino

Upload: fabio-cozzolino

Post on 05-Dec-2014

691 views

Category:

Technology


3 download

DESCRIPTION

 

TRANSCRIPT

Page 1: Notify your Windows Store app with Service Bus Notification Hub

Template designed by

notify you app

Fabio [email protected]://dotnetside.org/blogs/fabio@fabiocozzolino

Page 2: Notify your Windows Store app with Service Bus Notification Hub

brought to you by

Page 3: Notify your Windows Store app with Service Bus Notification Hub

Chief Software Architect presso CompuGROUP Medical Italia, dove mi occupo si sviluppo SOA e cloud

Microsoft Integration MVP

Presidente di DotNetSide, user group di Puglia e Basilicata

Autore dei libriProfessional WCF 4: Windows Communication Foundation with .NET 4

Windows Azure: Programmare per il Cloud Computing

chi sono

Page 4: Notify your Windows Store app with Service Bus Notification Hub

scenario

push notification concepts

service bus notification hub in action

agenda

Page 5: Notify your Windows Store app with Service Bus Notification Hub

Quanti di voi conoscono Windows Azure?

Avete mai sentito parlare di Service Bus?

Quanti hanno sviluppato/sviluppano app per Win8/RT?

poll

Page 6: Notify your Windows Store app with Service Bus Notification Hub

numero sempre crescente ed eterogeneo di device (...e di apps)

ho bisogno di notificare la mia app:aggiornamenti

notizie in tempo reale

instant messaging

ma i device non sempre sono connessi

... e qui nasce un problema ...

scenario

Page 7: Notify your Windows Store app with Service Bus Notification Hub

<<...e ora come glielo dico?>>

Page 8: Notify your Windows Store app with Service Bus Notification Hub

pull vs pushogni «device» deve essere trattato con il dovuto rispetto

dobbiamo considerare alcuni aspetti come: connettività

consumo di risorse (batteria)

applicazioni in background

push notification: perchè?

Page 9: Notify your Windows Store app with Service Bus Notification Hub

Push Notification types

Toast Notification

Tile Notification

Tile Notif...

Badge Notification 8

Page 10: Notify your Windows Store app with Service Bus Notification Hub

Push Notification

App

Registro il dispositivo ed ottengo l’handle

L’app riceve la notifica

Registro l’handle nel mio AppBackend

Invio la notifica al PNS utilizzando l’handle

(protocollo proprietario)App BackEnd Service

Push Notification

Service

Event SourceInvio la notifica

Subs

Page 11: Notify your Windows Store app with Service Bus Notification Hub

Push Notification

Service

Push Notification

Service

Push Notification API

App

Registro il dispositivo ed ottengo l’handle

L’app riceve la notifica

Registro l’handle nel mio AppBackend Invio la notifica via

APIApp BackEnd

Service

Push Notification

Service

Event SourceInvio la notifica

Subs

Intermediary API

Invio la notifica al PNS(protocollo proprietario)

Page 12: Notify your Windows Store app with Service Bus Notification Hub

Service Bus Notification Hub

App

Registro il dispositivo ed ottengo l’handle

L’app riceve la notifica

Registro l’handle nel Notification Hub

Invio la notifica al PNS utilizzando l’handle

(protocollo proprietario)Service Bus Notification Hub

Push Notification

Services

Event SourceInvio la notifica

Subs

Stats

Service Bus SDK

Page 13: Notify your Windows Store app with Service Bus Notification Hub

Gestore unico delle sottoscrizioni e delle statisticheDispatching dei messaggi e monitoring delle transazioni

Modalità unica di comunicazione (PNS)WNS - Windows Notification Service

APNS – Apple Push Notification Service

ASAPC2DM – Android Cloud to Device Messaging Framework

MPNS – Microsoft Push Notification Service

Windows Azure Service Bus Notification Hub

Page 14: Notify your Windows Store app with Service Bus Notification Hub

dem

o Hello World

Page 15: Notify your Windows Store app with Service Bus Notification Hub

Supporto per le notifiche cross-platform

Consentono di personalizzare le tipologie di notificheAtttraverso l’utilizzo di una property bag

Vengono definiti dall’applicazione

templates

iOS Template{“aps”: {“alert”:”$(message)”}}

Windows Store apps Template<toast> <visual> <binding template=\"ToastText01\"> <text id=\"1\">$(message)</text> </binding> </visual></toast>

Page 16: Notify your Windows Store app with Service Bus Notification Hub

Template registrationMaggiore complessità lato client

E’ il client responsabile della registrazione

Maggiore flessibilità nel backend

Native registrationIntegrazione lato client più semplice

Maggiore controllo della notifica nel backend

Creazione e nell’invio di più notifiche specifiche per piattaforma

templates vs native registration

Page 17: Notify your Windows Store app with Service Bus Notification Hub

Applicazione di filtri sulle sottoscrizioniSe specificati, il messaggio viene inviato solo a chi ne ha fatto richiesta

Coppie nome-valore aggiuntive ai templatesregistrate in fase di sottoscrizione

È il ServiceBus che lavora per noi 😎

tags

Page 18: Notify your Windows Store app with Service Bus Notification Hub

Shared Access SignatureChiave condivisa per la firma

Permessi a livello di operationin linea con il Service Bus di default: Listen e Listen,Send,Manage

Via SDK è possibile modificare le regole di autorizzazioneRegole di autorizzazione anche a livello di tags

security

Page 19: Notify your Windows Store app with Service Bus Notification Hub

Al momento il Notification Hub non sostituirà i Mobile Services

I due servizi saranno complementari

Il backend dei Mobile Services potrà utilizzare anche il Notification Hub, in grado di raggiungere una moltitudine di device, con in più il supporto ai tags

Notification Hub vs Mobile Services

Page 20: Notify your Windows Store app with Service Bus Notification Hub

A Windows Store development account

Service Bus .NET Preview SDKA NuGet package that contains Service Bus preview features

Service Bus WinRT Managed SDKhttp://go.microsoft.com/fwlink/?LinkID=277160

What you need: tools & sdk

Page 21: Notify your Windows Store app with Service Bus Notification Hub

Grazie a tutti per la partecipazione

Riceverete il link per il download a slide e demo via email nei prossimi giorni

Per contattarmi

[email protected]

@fabiocozzolino

Grazie

Page 22: Notify your Windows Store app with Service Bus Notification Hub

Il potere è come la contrazione della balestra; la tempestività,

come lo scoccare del dardo

Page 23: Notify your Windows Store app with Service Bus Notification Hub

Bonus

Page 24: Notify your Windows Store app with Service Bus Notification Hub

Service Bus Communication Patterns

Relayed Messaging Brokered Messaging(Topics,Queue)

Page 25: Notify your Windows Store app with Service Bus Notification Hub

Relay vs. Message Broker

Il Relay instrada i messaggi attraverso il cloud utilizzando l’algoritmo Backpressure Feedback che consente

l’accodamento e l’immediato scodamento dei messaggi nei vari nodi attraversati

Route

AuthN/ZBackpressure Feedback

Query FilterPull

AuthN/Z

Brokers mantengono i messaggi per il successivo recupero o interrogazione

Page 26: Notify your Windows Store app with Service Bus Notification Hub

Brokered Transfer

Load LevelingReceiver ricevono e processano i messaggi secondo le loro esigenze. Non devono mai essere sovraccaricati. E’ possibile aggiungere nuovi Receivers se il carico aumenta o ridurli se diminuisce, gestendo i picchi di carico senza stressare il backend.

Offline/BatchIl Receiver può essere offline per diverse ragioni. Le richieste vengono quindi “bufferizzate” fino al momento in cui ritorna disponibile.

Page 27: Notify your Windows Store app with Service Bus Notification Hub

Competing Consumer

Load BalancingPiù Receivers possono ascoltare sulla stessa coda

Tips: osservare il numero di messaggi “in coda” in attesa di essere processati può essere considerato come un indicatore per variare il numero di Receivers

Page 28: Notify your Windows Store app with Service Bus Notification Hub

TopicsSubSubSub

Message DistributionLe sottoscrizioni sono indipendenti e ogni Receiver avrà la sua copia del messaggio. Permette a molti Subscribers di regolare il flusso dei messaggi. Un Subscriber può creare filtri in base ai suoi interessi.

Constrained Message Distribution (Partitioning)Ogni Receiver riceverà una parte del flusso dei messaggi, permettendo una distribuzione sulla base delle condizioni espresse nei filtri.

Date>01/01/2012ShipDestCity=‘Bari’

Page 29: Notify your Windows Store app with Service Bus Notification Hub

Thanks