SlideShare una empresa de Scribd logo
October 4th, 5th & 6th 2018.NET Conf AR v2018
Futbol multi-screen
con Azure SignalR Service
Ing. Jose A. Fernandez
Tech Lead
@fernandezja
October 4th, 5th & 6th 2018.NET Conf AR v2018
Agenda
• SignalR
• Que es? Que versiones existen?
• Diferencias/Cambios
• Ping charla v2017 #NETConfAR
• Performance/Escalamiento
• Demo
• Azure SignalR Service
• Configuracion
• Conexiones
October 4th, 5th & 6th 2018.NET Conf AR v2018
SignalR. Que es? Repasando
• Apps en real-time increíblemente simple para .NET
• Provee una capa de abstracción sobre algunos de los transportes
• API Hubs para server-based push hacia web clients
• Clientes for JavaScript/Typescript, C#, C++, & Java
• Tipo de Conexiones…
• Forever Frames
• ServerSentEvent
• LongPolling
• Websockets
October 4th, 5th & 6th 2018.NET Conf AR v2018
SignalR a la carta
• Dos versiones
ASP.NET SignalR
ASP.NET Core SignalR
October 4th, 5th & 6th 2018.NET Conf AR v2018
ASP.NET SignalR / ASP.NET Core SignalR
ASP.NET SignalR ASP.NET Core SignalR
Server NuGet Package Microsoft.AspNet.SignalR Microsoft.AspNetCore.App (.NET Core)
Microsoft.AspNetCore.SignalR (.NET
Framework)
Client NuGet Packages Microsoft.AspNet.SignalR.Client
Microsoft.AspNet.SignalR.JS
Microsoft.AspNetCore.SignalR.Client
Client npm Package signalr @aspnet/signalr
Server App Type ASP.NET (System.Web) or OWIN Self-Host ASP.NET Core
Supported Server Platforms .NET Framework 4.5 or later .NET Framework 4.6.1 or later
.NET Core 2.1 or later
https://docs.microsoft.com/en-us/aspnet/core/signalr/version-differences?view=aspnetcore-2.1
October 4th, 5th & 6th 2018.NET Conf AR v2018
Ping to! Charla de v2017 #NETConfAR
• Aplicaciones en tiempo real con SignalR Core
https://youtu.be/EeAODcaeoqA
• Florencia Nodar
• Nicolas Granata
October 4th, 5th & 6th 2018.NET Conf AR v2018
Cambios
• Reconexiones automáticas.
• No se admiten
• Protocolos de mensajes
• JSON
• MessagePack (binario)
• … y se puede extender
• Streaming
October 4th, 5th & 6th 2018.NET Conf AR v2018
SignalR
¿Dónde se ejecuta?
October 4th, 5th & 6th 2018.NET Conf AR v2018
Donde se ejecuta?
• Para aplicaciones .NET…
• en nuestra apps,
• en el mismo contexto
• ¿Y si vamos a recibir miles de mensajes por segundo?
• Tenemos que escalar? Como?
• Garantizar que el rendimiento no se vea obstaculizado por la
generación de tráfico de red innecesario.
October 4th, 5th & 6th 2018.NET Conf AR v2018
Escalando
SignalR
mmm!
October 4th, 5th & 6th 2018.NET Conf AR v2018
Escalando SignalR
• Regulación de frecuencia de mensajes
• Cantidad de mensajes por segundo
• Pool de mensajes. Queue… y enviar en un rate adecuado
• Reducir el tamaño del mensaje
• Ver el objeto de transferencia (DTO).
• Propiedades… socialización
• Propiedades… nombres
• MessagePack!
October 4th, 5th & 6th 2018.NET Conf AR v2018
Escalando/Performance SignalR
• Regulación de frecuencia de mensajes
• Cantidad de mensajes por segundo
• Pool de mensajes. Queue… y enviar en un rate adecuado
• Reducir el tamaño del mensaje
• Ver el objeto de transferencia (DTO).
• Propiedades… socialización
• Propiedades… nombres
• MessagePack!
October 4th, 5th & 6th 2018.NET Conf AR v2018
Escalando/Performance SignalR
• Ajuste de su servidor SignalR …rendimiento
• DefaultMessageBufferSize
• Por Default … SignalR conserva 1000 mensajes en memoria por Hub por
conexión
• Mensajes grandes?
• Ajustes de configuración de IIS
• Max concurrent requests per application
• ApplicationPool QueueLength
cd %windir%System32inetsrv appcmd.exe set config
/section:system.webserver/serverRuntime
/appConcurrentRequestLimit:10000
October 4th, 5th & 6th 2018.NET Conf AR v2018
Escalando/Performance SignalR
• ASP.NET Configuracion de la Apps
• Maximum concurrent requests per CPU
• Request Queue Limit
<configuration>
<system.web>
<applicationPool maxConcurrentRequestsPerCPU="20000" />
</system.web>
</configuration>
<processModel autoConfig="false" requestQueueLimit="250000" />
October 4th, 5th & 6th 2018.NET Conf AR v2018
Scale out SignalR
https://docs.microsoft.com/en-us/aspnet/signalr/overview/performance/scaleout-in-signalr
+ Servers Con Backplane
October 4th, 5th & 6th 2018.NET Conf AR v2018
SignalR Backplanes
• Azure Service Bus
• Redis
• SQL Server
October 4th, 5th & 6th 2018.NET Conf AR v2018
Ops!
Operaciones
Infraestructura
October 4th, 5th & 6th 2018.NET Conf AR v2018
MessagePack en ASP.NET Core SignalR
• It's like JSON.
but fast and small.
• https://msgpack.org/
October 4th, 5th & 6th 2018.NET Conf AR v2018
Streaming en ASP.NET Core SignalR
• Admite la transmisión streaming desde el servidor
• Util….cuando los fragmentos de datos llegaran en un lapso de tiempo.
• Cada fragmento se envía al cliente tan pronto como está disponible
October 4th, 5th & 6th 2018.NET Conf AR v2018
Streaming
en ASP.NET
Core
SignalR
October 4th, 5th & 6th 2018.NET Conf AR v2018
Demo
October 4th, 5th & 6th 2018.NET Conf AR v2018
October 4th, 5th & 6th 2018.NET Conf AR v2018
Demo
October 4th, 5th & 6th 2018.NET Conf AR v2018
Demo
http://bit.ly/soccer-signalr
October 4th, 5th & 6th 2018.NET Conf AR v2018
Azure SignalR Service
https://azure.com/signalr
October 4th, 5th & 6th 2018.NET Conf AR v2018
Azure SignalR Service
https://azure.com/signalr
• Es un servicio completamente administrado
• Permite utilizar ASP.NET Core SignalR para
crear app que requieran experiencias e
interacciones en tiempo real
• Como chat, live panels, gráficos, futbol...
• Sin preocuparse por
• el aprovisionamiento de la capacidad,
• el escalamiento
• o las conexiones persistentes.
October 4th, 5th & 6th 2018.NET Conf AR v2018
October 4th, 5th & 6th 2018.NET Conf AR v2018
October 4th, 5th & 6th 2018.NET Conf AR v2018
Azure SignalR Service…
Rápido
y Sencillo
Centrado en el
negocio
Potencial con
otros servicios
October 4th, 5th & 6th 2018.NET Conf AR v2018
Si ya utilizamos SignalR ….
• Paquete Microsoft.Azure.SignalR (Core)
...Microsoft.Azure.SignalR.AspNet
• Configuración Liviana (en Startup)
Rápido
y Sencillo
October 4th, 5th & 6th 2018.NET Conf AR v2018
Si ya utilizamos SignalR ….
• ConectionString
1. Environment Variable
• Azure:SignalR:ConnectionString
• Azure__SignalR__ConnectionString
2. Param en AddAzureSignalR(“…”)
Rápido
y Sencillo
October 4th, 5th & 6th 2018.NET Conf AR v2018
Cliente….
• Mismo cliente de ASP.NET SignalR Core
npm install @aspnet/signalr
<script src="/lib/signalr/signalr.js"></script>
October 4th, 5th & 6th 2018.NET Conf AR v2018
Cliente….
• Misma configuración
• No hay nada exclusivo
de Azure SignalR
October 4th, 5th & 6th 2018.NET Conf AR v2018
Demo
October 4th, 5th & 6th 2018.NET Conf AR v2018
Conexiones del Servidor: Azure SignalR Service
• Expone endpoints por cada Hubs
• Responderá los request de conexiones
• Redirección al app service
• App server al iniciar el SDK abrirá
5 conexiones websockets
con el servicio de SignalR
• Siempre debe estar conectadas !!
• Si se desconecta, se cae todos los clientes
• Se auto reconecta
October 4th, 5th & 6th 2018.NET Conf AR v2018
Conexiones de Clientes: Azure SignalR Service
• Los clientes se conectan al Servicio
…en lugar del app server
• Proceso Cliente Request
1. Envía una solicitud de negociación
al app server
2. Con el SDK de Azure SignalR Service,
el app server devolverá una respuesta
de negociación de redireccionamiento
1. …con la URL del servicio de SignalR
y el token de acceso.
October 4th, 5th & 6th 2018.NET Conf AR v2018
Transporte de Datos: Azure SignalR Service
• Cliente se conectan al servicio
• Es valido hasta…
• El cliente se desconecte
• o el servidor de apps se desconecte
• Es una capa de transporte lógico
• Entre app server y clientes
• Todas las conexiones Azure SignalR
• El App Server lógica de Hubs
October 4th, 5th & 6th 2018.NET Conf AR v2018
Escalar Apps Services… A tener en cuenta
• Las conexiones van fuera del aplicación
• Pero la lógica de los Hubs todavía va a ser necesario escalar
• Cuando tendremos una carga significativa
October 4th, 5th & 6th 2018.NET Conf AR v2018
Escalar Apps Services…
• Varios app servers pueden conectarse a la misma instancia
del Azure SignalR.
• Mismo nombre de clase del Hub
• Se agrupan en el mismo Hub
• Cada conexión/cliente
• Se creara un uno solo app server
• Los mensajes del cliente se enviaran al mismo app server
• ¿Queremos acceder a Info del cliente globalmente?
• … Algun storage para read/write
October 4th, 5th & 6th 2018.NET Conf AR v2018
Personalizando Configuración
services.AddSignalR()
.AddAzureSignalR(options =>
{
options.ConnectionCount = 15;
options.AccessTokenLifetime = TimeSpan.FromDays(1);
options.ClaimsProvider = context => context.User.Claims;
});
October 4th, 5th & 6th 2018.NET Conf AR v2018
Azure SignalR Service
• Disponibilidad para utilizar con ASP.NET Core SignalR
• Todavía en public preview para ASP.NET SignalR
• Azure Functions binding
• https://github.com/Azure/azure-functions-signalrservice-extension
September 24, 2018
Azure SignalR Service now generally available
https://azure.microsoft.com/en-us/blog/azure-signalr-service-now-generally-available/
October 4th, 5th & 6th 2018.NET Conf AR v2018
Lista de Deseos… para la Demo.
• Soporte para recordar ID de pantalla en el browser
• Reconexión
• Mejorar la UI (Arcos, Gol)
• Mosaico mas amplio
• Extender ejemplo …
• Imágenes, Big-Screen
• #CosmosDB
• Serverless #AzureFunctions
• SaaS
October 4th, 5th & 6th 2018.NET Conf AR v2018
Muchas Gracias!
October 4th, 5th & 6th 2018.NET Conf AR v2018
Enlaces
• https://azure.com/signalr
• https://docs.microsoft.com/en-us/azure/azure-signalr/
• https://github.com/fernandezja/soccer-multi-screen-
signalr/tree/master
October 4th, 5th & 6th 2018.NET Conf AR v2018
Muchas Gracias! 
https://github.com/fernandezja
@fernandezja
Ing. Jose A. Fernandez
https://www.linkedin.com/in/fernandezja/

Más contenido relacionado

PPTX
Net conf ar v2018 start up
PPTX
Plainconcepts .Net Core Event - Real Time Applications
PPTX
Realtime Apps en .NET Core by Carlos Landeras y Manuel Rodrigo Cabello
PPTX
SignalR NET Conf AR v2017
PPTX
Cómputo en la nube, diferentes sabores para todas nuestras necesidades - .NET...
PPTX
Aplicaciones en tiempo real con SignalR y .NET CORE
PPTX
AWSome Day - Conferencia Online Junio 2020
PPTX
DotNetConf Madrid
Net conf ar v2018 start up
Plainconcepts .Net Core Event - Real Time Applications
Realtime Apps en .NET Core by Carlos Landeras y Manuel Rodrigo Cabello
SignalR NET Conf AR v2017
Cómputo en la nube, diferentes sabores para todas nuestras necesidades - .NET...
Aplicaciones en tiempo real con SignalR y .NET CORE
AWSome Day - Conferencia Online Junio 2020
DotNetConf Madrid

Similar a Futbol multi-screen con Azure SignalR Services (20)

PDF
Derribando la torre de marfil - Plain Concepts Dev Day
PPTX
Azure bootcampo 2019 start up_v1
PPTX
ASP.NET MVC
PPTX
ROS-RoboMaker-ROS2-Spanish-Presentation
PPTX
Novedades .Net Core - NetBaires
PPT
Genesis Suite Server
PDF
Comenzando con aplicaciones serverless en AWS
PPTX
Trabajo fin de master Dirección TI
PDF
Azure Realtime analytics: Análisis de datos en tiempo real
PDF
Orquestación de Microservicios Introducción a arquitecturas de desarrollo mod...
PDF
Commit conf arquitectura-microservicios_v1.0
PPTX
Dynamics saturday madrid 2019 web api
PPTX
.Net Conf UY 2017: Un paseo por Azure Service Fabric
PPTX
Open platform - Conferencia Esri 2016
PDF
Arquitecturas Serverless con IoT, Machine Learning y Asistentes de Voz
PPTX
04 17-2021 - procesando modelos tabulares global azure latam
PPSX
Reconnect(); // 2015 - DotNetters
PDF
Webinar Migración de Forms & Reports a Oracle Cloud
PPTX
Microsoft machine learning
PDF
Innovation Track AWS Cloud Experience Argentina - Novedades de Distribución d...
Derribando la torre de marfil - Plain Concepts Dev Day
Azure bootcampo 2019 start up_v1
ASP.NET MVC
ROS-RoboMaker-ROS2-Spanish-Presentation
Novedades .Net Core - NetBaires
Genesis Suite Server
Comenzando con aplicaciones serverless en AWS
Trabajo fin de master Dirección TI
Azure Realtime analytics: Análisis de datos en tiempo real
Orquestación de Microservicios Introducción a arquitecturas de desarrollo mod...
Commit conf arquitectura-microservicios_v1.0
Dynamics saturday madrid 2019 web api
.Net Conf UY 2017: Un paseo por Azure Service Fabric
Open platform - Conferencia Esri 2016
Arquitecturas Serverless con IoT, Machine Learning y Asistentes de Voz
04 17-2021 - procesando modelos tabulares global azure latam
Reconnect(); // 2015 - DotNetters
Webinar Migración de Forms & Reports a Oracle Cloud
Microsoft machine learning
Innovation Track AWS Cloud Experience Argentina - Novedades de Distribución d...
Publicidad

Último (20)

PPTX
RAP02 - TECNICO SISTEMAS TELEINFORMATICOS.pptx
PPTX
ANCASH-CRITERIOS DE EVALUACIÓN-FORMA-10-10 (2).pptx
PDF
clase auditoria informatica 2025.........
PPTX
RAP01 - TECNICO SISTEMAS TELEINFORMATICOS.pptx
PPTX
Presentación PASANTIAS AuditorioOO..pptx
PDF
Calidad desde el Docente y la mejora continua .pdf
PPTX
Propuesta BKP servidores con Acronis1.pptx
PPTX
Presentación de Redes de Datos modelo osi
PDF
Diapositiva proyecto de vida, materia catedra
PPTX
historia_web de la creacion de un navegador_presentacion.pptx
DOCX
Zarate Quispe Alex aldayir aplicaciones de internet .docx
PDF
taller de informática - LEY DE OHM
PDF
SAP Transportation Management para LSP, TM140 Col18
PPTX
COMO AYUDAN LAS TIC EN LA EDUCACION SUPERIOR.pptx
PDF
Instrucciones simples, respuestas poderosas. La fórmula del prompt perfecto.
PPT
El-Gobierno-Electrónico-En-El-Estado-Bolivia
PPT
introduccion a las_web en el 2025_mejoras.ppt
PPTX
Sesion 1 de microsoft power point - Clase 1
PDF
CyberOps Associate - Cisco Networking Academy
PPTX
IA de Cine - Como MuleSoft y los Agentes estan redefiniendo la realidad
RAP02 - TECNICO SISTEMAS TELEINFORMATICOS.pptx
ANCASH-CRITERIOS DE EVALUACIÓN-FORMA-10-10 (2).pptx
clase auditoria informatica 2025.........
RAP01 - TECNICO SISTEMAS TELEINFORMATICOS.pptx
Presentación PASANTIAS AuditorioOO..pptx
Calidad desde el Docente y la mejora continua .pdf
Propuesta BKP servidores con Acronis1.pptx
Presentación de Redes de Datos modelo osi
Diapositiva proyecto de vida, materia catedra
historia_web de la creacion de un navegador_presentacion.pptx
Zarate Quispe Alex aldayir aplicaciones de internet .docx
taller de informática - LEY DE OHM
SAP Transportation Management para LSP, TM140 Col18
COMO AYUDAN LAS TIC EN LA EDUCACION SUPERIOR.pptx
Instrucciones simples, respuestas poderosas. La fórmula del prompt perfecto.
El-Gobierno-Electrónico-En-El-Estado-Bolivia
introduccion a las_web en el 2025_mejoras.ppt
Sesion 1 de microsoft power point - Clase 1
CyberOps Associate - Cisco Networking Academy
IA de Cine - Como MuleSoft y los Agentes estan redefiniendo la realidad
Publicidad

Futbol multi-screen con Azure SignalR Services

  • 1. October 4th, 5th & 6th 2018.NET Conf AR v2018 Futbol multi-screen con Azure SignalR Service Ing. Jose A. Fernandez Tech Lead @fernandezja
  • 2. October 4th, 5th & 6th 2018.NET Conf AR v2018 Agenda • SignalR • Que es? Que versiones existen? • Diferencias/Cambios • Ping charla v2017 #NETConfAR • Performance/Escalamiento • Demo • Azure SignalR Service • Configuracion • Conexiones
  • 3. October 4th, 5th & 6th 2018.NET Conf AR v2018 SignalR. Que es? Repasando • Apps en real-time increíblemente simple para .NET • Provee una capa de abstracción sobre algunos de los transportes • API Hubs para server-based push hacia web clients • Clientes for JavaScript/Typescript, C#, C++, & Java • Tipo de Conexiones… • Forever Frames • ServerSentEvent • LongPolling • Websockets
  • 4. October 4th, 5th & 6th 2018.NET Conf AR v2018 SignalR a la carta • Dos versiones ASP.NET SignalR ASP.NET Core SignalR
  • 5. October 4th, 5th & 6th 2018.NET Conf AR v2018 ASP.NET SignalR / ASP.NET Core SignalR ASP.NET SignalR ASP.NET Core SignalR Server NuGet Package Microsoft.AspNet.SignalR Microsoft.AspNetCore.App (.NET Core) Microsoft.AspNetCore.SignalR (.NET Framework) Client NuGet Packages Microsoft.AspNet.SignalR.Client Microsoft.AspNet.SignalR.JS Microsoft.AspNetCore.SignalR.Client Client npm Package signalr @aspnet/signalr Server App Type ASP.NET (System.Web) or OWIN Self-Host ASP.NET Core Supported Server Platforms .NET Framework 4.5 or later .NET Framework 4.6.1 or later .NET Core 2.1 or later https://docs.microsoft.com/en-us/aspnet/core/signalr/version-differences?view=aspnetcore-2.1
  • 6. October 4th, 5th & 6th 2018.NET Conf AR v2018 Ping to! Charla de v2017 #NETConfAR • Aplicaciones en tiempo real con SignalR Core https://youtu.be/EeAODcaeoqA • Florencia Nodar • Nicolas Granata
  • 7. October 4th, 5th & 6th 2018.NET Conf AR v2018 Cambios • Reconexiones automáticas. • No se admiten • Protocolos de mensajes • JSON • MessagePack (binario) • … y se puede extender • Streaming
  • 8. October 4th, 5th & 6th 2018.NET Conf AR v2018 SignalR ¿Dónde se ejecuta?
  • 9. October 4th, 5th & 6th 2018.NET Conf AR v2018 Donde se ejecuta? • Para aplicaciones .NET… • en nuestra apps, • en el mismo contexto • ¿Y si vamos a recibir miles de mensajes por segundo? • Tenemos que escalar? Como? • Garantizar que el rendimiento no se vea obstaculizado por la generación de tráfico de red innecesario.
  • 10. October 4th, 5th & 6th 2018.NET Conf AR v2018 Escalando SignalR mmm!
  • 11. October 4th, 5th & 6th 2018.NET Conf AR v2018 Escalando SignalR • Regulación de frecuencia de mensajes • Cantidad de mensajes por segundo • Pool de mensajes. Queue… y enviar en un rate adecuado • Reducir el tamaño del mensaje • Ver el objeto de transferencia (DTO). • Propiedades… socialización • Propiedades… nombres • MessagePack!
  • 12. October 4th, 5th & 6th 2018.NET Conf AR v2018 Escalando/Performance SignalR • Regulación de frecuencia de mensajes • Cantidad de mensajes por segundo • Pool de mensajes. Queue… y enviar en un rate adecuado • Reducir el tamaño del mensaje • Ver el objeto de transferencia (DTO). • Propiedades… socialización • Propiedades… nombres • MessagePack!
  • 13. October 4th, 5th & 6th 2018.NET Conf AR v2018 Escalando/Performance SignalR • Ajuste de su servidor SignalR …rendimiento • DefaultMessageBufferSize • Por Default … SignalR conserva 1000 mensajes en memoria por Hub por conexión • Mensajes grandes? • Ajustes de configuración de IIS • Max concurrent requests per application • ApplicationPool QueueLength cd %windir%System32inetsrv appcmd.exe set config /section:system.webserver/serverRuntime /appConcurrentRequestLimit:10000
  • 14. October 4th, 5th & 6th 2018.NET Conf AR v2018 Escalando/Performance SignalR • ASP.NET Configuracion de la Apps • Maximum concurrent requests per CPU • Request Queue Limit <configuration> <system.web> <applicationPool maxConcurrentRequestsPerCPU="20000" /> </system.web> </configuration> <processModel autoConfig="false" requestQueueLimit="250000" />
  • 15. October 4th, 5th & 6th 2018.NET Conf AR v2018 Scale out SignalR https://docs.microsoft.com/en-us/aspnet/signalr/overview/performance/scaleout-in-signalr + Servers Con Backplane
  • 16. October 4th, 5th & 6th 2018.NET Conf AR v2018 SignalR Backplanes • Azure Service Bus • Redis • SQL Server
  • 17. October 4th, 5th & 6th 2018.NET Conf AR v2018 Ops! Operaciones Infraestructura
  • 18. October 4th, 5th & 6th 2018.NET Conf AR v2018 MessagePack en ASP.NET Core SignalR • It's like JSON. but fast and small. • https://msgpack.org/
  • 19. October 4th, 5th & 6th 2018.NET Conf AR v2018 Streaming en ASP.NET Core SignalR • Admite la transmisión streaming desde el servidor • Util….cuando los fragmentos de datos llegaran en un lapso de tiempo. • Cada fragmento se envía al cliente tan pronto como está disponible
  • 20. October 4th, 5th & 6th 2018.NET Conf AR v2018 Streaming en ASP.NET Core SignalR
  • 21. October 4th, 5th & 6th 2018.NET Conf AR v2018 Demo
  • 22. October 4th, 5th & 6th 2018.NET Conf AR v2018
  • 23. October 4th, 5th & 6th 2018.NET Conf AR v2018 Demo
  • 24. October 4th, 5th & 6th 2018.NET Conf AR v2018 Demo http://bit.ly/soccer-signalr
  • 25. October 4th, 5th & 6th 2018.NET Conf AR v2018 Azure SignalR Service https://azure.com/signalr
  • 26. October 4th, 5th & 6th 2018.NET Conf AR v2018 Azure SignalR Service https://azure.com/signalr • Es un servicio completamente administrado • Permite utilizar ASP.NET Core SignalR para crear app que requieran experiencias e interacciones en tiempo real • Como chat, live panels, gráficos, futbol... • Sin preocuparse por • el aprovisionamiento de la capacidad, • el escalamiento • o las conexiones persistentes.
  • 27. October 4th, 5th & 6th 2018.NET Conf AR v2018
  • 28. October 4th, 5th & 6th 2018.NET Conf AR v2018
  • 29. October 4th, 5th & 6th 2018.NET Conf AR v2018 Azure SignalR Service… Rápido y Sencillo Centrado en el negocio Potencial con otros servicios
  • 30. October 4th, 5th & 6th 2018.NET Conf AR v2018 Si ya utilizamos SignalR …. • Paquete Microsoft.Azure.SignalR (Core) ...Microsoft.Azure.SignalR.AspNet • Configuración Liviana (en Startup) Rápido y Sencillo
  • 31. October 4th, 5th & 6th 2018.NET Conf AR v2018 Si ya utilizamos SignalR …. • ConectionString 1. Environment Variable • Azure:SignalR:ConnectionString • Azure__SignalR__ConnectionString 2. Param en AddAzureSignalR(“…”) Rápido y Sencillo
  • 32. October 4th, 5th & 6th 2018.NET Conf AR v2018 Cliente…. • Mismo cliente de ASP.NET SignalR Core npm install @aspnet/signalr <script src="/lib/signalr/signalr.js"></script>
  • 33. October 4th, 5th & 6th 2018.NET Conf AR v2018 Cliente…. • Misma configuración • No hay nada exclusivo de Azure SignalR
  • 34. October 4th, 5th & 6th 2018.NET Conf AR v2018 Demo
  • 35. October 4th, 5th & 6th 2018.NET Conf AR v2018 Conexiones del Servidor: Azure SignalR Service • Expone endpoints por cada Hubs • Responderá los request de conexiones • Redirección al app service • App server al iniciar el SDK abrirá 5 conexiones websockets con el servicio de SignalR • Siempre debe estar conectadas !! • Si se desconecta, se cae todos los clientes • Se auto reconecta
  • 36. October 4th, 5th & 6th 2018.NET Conf AR v2018 Conexiones de Clientes: Azure SignalR Service • Los clientes se conectan al Servicio …en lugar del app server • Proceso Cliente Request 1. Envía una solicitud de negociación al app server 2. Con el SDK de Azure SignalR Service, el app server devolverá una respuesta de negociación de redireccionamiento 1. …con la URL del servicio de SignalR y el token de acceso.
  • 37. October 4th, 5th & 6th 2018.NET Conf AR v2018 Transporte de Datos: Azure SignalR Service • Cliente se conectan al servicio • Es valido hasta… • El cliente se desconecte • o el servidor de apps se desconecte • Es una capa de transporte lógico • Entre app server y clientes • Todas las conexiones Azure SignalR • El App Server lógica de Hubs
  • 38. October 4th, 5th & 6th 2018.NET Conf AR v2018 Escalar Apps Services… A tener en cuenta • Las conexiones van fuera del aplicación • Pero la lógica de los Hubs todavía va a ser necesario escalar • Cuando tendremos una carga significativa
  • 39. October 4th, 5th & 6th 2018.NET Conf AR v2018 Escalar Apps Services… • Varios app servers pueden conectarse a la misma instancia del Azure SignalR. • Mismo nombre de clase del Hub • Se agrupan en el mismo Hub • Cada conexión/cliente • Se creara un uno solo app server • Los mensajes del cliente se enviaran al mismo app server • ¿Queremos acceder a Info del cliente globalmente? • … Algun storage para read/write
  • 40. October 4th, 5th & 6th 2018.NET Conf AR v2018 Personalizando Configuración services.AddSignalR() .AddAzureSignalR(options => { options.ConnectionCount = 15; options.AccessTokenLifetime = TimeSpan.FromDays(1); options.ClaimsProvider = context => context.User.Claims; });
  • 41. October 4th, 5th & 6th 2018.NET Conf AR v2018 Azure SignalR Service • Disponibilidad para utilizar con ASP.NET Core SignalR • Todavía en public preview para ASP.NET SignalR • Azure Functions binding • https://github.com/Azure/azure-functions-signalrservice-extension September 24, 2018 Azure SignalR Service now generally available https://azure.microsoft.com/en-us/blog/azure-signalr-service-now-generally-available/
  • 42. October 4th, 5th & 6th 2018.NET Conf AR v2018 Lista de Deseos… para la Demo. • Soporte para recordar ID de pantalla en el browser • Reconexión • Mejorar la UI (Arcos, Gol) • Mosaico mas amplio • Extender ejemplo … • Imágenes, Big-Screen • #CosmosDB • Serverless #AzureFunctions • SaaS
  • 43. October 4th, 5th & 6th 2018.NET Conf AR v2018 Muchas Gracias!
  • 44. October 4th, 5th & 6th 2018.NET Conf AR v2018 Enlaces • https://azure.com/signalr • https://docs.microsoft.com/en-us/azure/azure-signalr/ • https://github.com/fernandezja/soccer-multi-screen- signalr/tree/master
  • 45. October 4th, 5th & 6th 2018.NET Conf AR v2018 Muchas Gracias!  https://github.com/fernandezja @fernandezja Ing. Jose A. Fernandez https://www.linkedin.com/in/fernandezja/

Notas del editor

  • #5: API interfaces and behaviors are different
  • #30: Con el servicio Azure SignalR, agregar comunicaciones en tiempo real a su aplicación web es tan simple como aprovisionar un servicio, ¡no es necesario que sea un gurú de las comunicaciones en tiempo real! No tiene que aprovisionar y mantener servidores solo porque necesita funciones en tiempo real en su solución. El servicio SignalR se administra completamente, lo que facilita la adición de funciones de comunicación en tiempo real a su aplicación. ¡No se preocupe más por el alojamiento, la escalabilidad, el equilibrio de carga y tales detalles! ¡Benefíciese de todo lo que Azure tiene para ofrecer! Se integra fácilmente con servicios como Azure Functions, Azure Active Directory, Azure Storage, Azure App Service, Azure Analytics, Power BI, IoT, Servicios cognitivos, Machine Learning y más.
  • #31: Microsoft.Azure.SignalR Microsoft.Azure.SignalR.AspNet dotnet add package Microsoft.Azure.SignalR --version 1.0.*
  • #32: services.AddSignalR() .AddAzureSignalR(<replace with your connection string>); or services.AddSignalR() .AddAzureSignalR(options => options.ConnectionString = <replace with your connection string>);
  • #37: {      "url": "https: //test.service.signalr.net: 5001 / client /? hub = chat & ...",      "accessToken": "<un token JWT típico>",      "AvailableTransports": [] }
  • #38: {      "url": "https: //test.service.signalr.net: 5001 / client /? hub = chat & ...",      "accessToken": "<un token JWT típico>",      "AvailableTransports": [] }
  • #41: ConnectionCount Esta opción controla el número de conexiones entre el servidor de aplicaciones y el servicio Azure SignalR AccessTokenLifetime El valor predeterminado es 1 hora. Esta opción controla la vida útil válida del token de acceso, que es generado por Service SDK para cada cliente. El token de acceso se devuelve en la respuesta a la solicitud de negociación del cliente. Cuando se utiliza ServerSentEvent o LongPolling como transporte, la conexión del cliente se cerrará debido a un error de autenticación después del tiempo de caducidad. Puede aumentar este valor para evitar la desconexión del cliente. ClaimsProvider Esta opción controla los reclamos que desea asociar con la conexión del cliente. Se utilizará cuando Service SDK genere un token de acceso para el cliente en la solicitud de negociación del cliente. De forma predeterminada, todas las reclamaciones de HttpContext.User de la solicitud de negociación estarán reservadas. Se puede acceder a ellos en Hub.Context.User.