SlideShare ist ein Scribd-Unternehmen logo
1 von 28
Downloaden Sie, um offline zu lesen
Academy #3
16th November 2015
Mickaël Rémond, @mickael
Questions
ejabberd questions
• How does Apple and Google Push support work on ejabberd SaaS and
ejabberd Business Edition ?
• What is the relationship between ejabberd Push support and XEP-0357:
Push Notifications ?
XMPP questions
• What is the impact of Websocket on Web chat performance ?
• What is the XMPP stack for quick prototyping ?
• Why do we seem to find duplicate in Message Archive Management
backend ?
What are Push Notifications and why do they matter ?
• Most smartphones Operating Systems are saving battery life by preventing
apps to run constantly and access network in background:
• On iOS, since iOS 3.
• On Android since Android 6.
• For a chat application, it means that:
• your application is suspended shortly after user put it to background.
• as a result you cannot directly receive messages.
=> You need an OS provider service that will awake your app when there is
message available for you on ejabberd.
Push service overview
Push service overview
Push app+device are identified with token
ejabberd
Push
ejabberd support for Push
• ejabberd SaaS and Business Edition natively support push notifications.
• Prerequisite for ejabberd configuration:
• iOS:
• App ID
• APNS sandbox and production certificates
• Android:
• Application package name
• API Key
• Prerequisite on client-side:
• iOS: Retrieve or update Device Token.
• Android: Retrieve or update Registration ID
ejabberd support for Push
• Client configuration is done with IQ stanza in the XMPP stream, after authentication.
<iq	type='set'	id='123'>	
	<push	xmlns='p1:push'	apn-sandbox='false'>	
		<keepalive	max="30"/>	
		<session	duration="60"/>	
		<body	send="all"	groupchat="true"	from="jid"/>	
		<status	type="xa">Text	Message	when	in	push	mode</status>	
		<offline>false</offline>	
		<notification>	
			<type>applepush</type>	
			<id>DeviceToken</id>	
		</notification>	
		<appid>application1</appid>	
	</push>	
</iq>
iOS notification sub elements
<iq	type='set'	id='123'>	
	<push	xmlns='p1:push'	apn-sandbox='false'>	
		<appid>AppID</appid>	
		<notification>	
			<type>applepush</type>	
			<id>DeviceToken</id>	
		</notification>	
		…	
	</push>	
</iq>
Android notification sub elements
<iq	type='set'	id='123'>	
	<push	xmlns='p1:push'	apn-sandbox='false'>	
		<appid>ApplicationPackageName</appid>	
		<notification>	
			<type>gcm</type>	
			<id>RegistrationID</id>	
		</notification>	
		…	
	</push>	
</iq>
ejabberd push triggers
• Message received while session is detached or user is offline.
• Groupchat messages while user session is running and possibly detached (optional)
• Badges: Automatic support for message counts. Auto reset on login.
Unread badge reset
<iq	type='set'	id='123'>	
		<badge	xmlns='p1:push'	unread='10'/>	
</iq>
Push setting customisations: Per sender sound
<iq	type="set"	id="cust1">	
		<customize	xmlns="p1:push:customize">	
				<item	from="adam@example.com"	mute="true"/>	
				<item	from="eve@example.com"	sound="horn.wav"/>	
		</customize>	
</iq>
Per message customisation
Custom fields in messages:
• This could allow clients to taylor rendering:
<message>	
...	
<x	xmlns="p1:push:custom"	key="AAA"	value="BBB">	
...	
</message>
Per message customisation
Per message sound customization:
<message	type="chat"	from="peer@example.com">	
		<body>Hello!</body>	
		<customize	xmlns="p1:push:customize"	sound="2.wav"/>	
</message>	
Or mute:
<message	type="chat"	from="peer@example.com">	
		<body>System	message:	...</body>	
		<customize	xmlns="p1:push:customize"	mute="true"/>	
</message>
Per message customisation
Customise body and nick displayed:
<message	type="chat"	from="peer@example.com">	
		<body>{matchResult:	"2:1",	Players:	[...]}</body>	
		<customize	xmlns="p1:push:customize"	nick="SportBot">	
				<body>Match	result	update	2:1	for	...</body>	
		</customize>	
</message>
Support for silent pushes
• Silent pushes are intended for the app only.
• They provide metadata for the app and can trigger background processing without displaying an alert
to the user.
• Useful to trigger background synchronisation when data are available.
Push Caveats
• Groupchat notifications are only possible when user is online or session is running on server in
detached mode.
• => We are adding feature to groupchat to dealt with that part.
• Apple Push buffer only contains one message:
• Do not expected to never miss a push: If your phone is turn off, you will only receive the latest
push when turned off.
• If this was a silent push, nothing will be visible to the user.
What is the relationship between ejabberd Push
support and XEP-0357: Push Notifications ?
• They cover different use cases:
• XEP-0357 defines:
• a way for app devices to pass their push credential to service.
• a standard API to trigger push notification from XMPP packets.
• XEP-0357 does not define the triggers:
• When and what the server is supposed to do to send push notifications to users.
• It assumes that it is mostly used by third-party services or component to send pushes.
• Our push approach fills the gap between:
• Server events that should trigger push notification, along with the format of such notifications.
• Actually sending the push to the device manufacturer push service.
What is the impact of Websocket on Web chat
performance ?
• On server, Websocket is a much more efficient protocol that takes less resources.
• However, impact on latency is directly visible on client.
Measurement of time to open session: Bosh vs
Websocket
• On server, Websocket is a much more efficient protocol that takes less resources.
• However, impact on latency is directly visible on client.
• Bosh (localhost, no SSL): 1428ms
• Websocket (localhost, no SSL): 307ms
• Bosh (remote server, SSL): 2198ms
• Websocket (remote server, SSL): 1446ms
• The more roundtrip you have, the more impact:
• Websocket is much better when there is a lot of interactions: Discovery, forms, server
configuration, etc.
What is the XMPP stack for quick prototyping ?
• Versatile and widely used server: ejabberd
• Client stack:
• Android: Smack 4
• iOS: XMPPFramework
• Web: Strophe
Using Strophe for prototyping / learning XMPP and
experimenting
• With a basic client, you can use the JS console to prepare and send XMPP packets:
presence = $pres();
connection.send(presence);
presence = $pres().c("status").t("away");
connection.send(presence);
message = $msg({to: "test@localhost", type: "chat"}).c("body").t("Hello
XMPP Academy !");
connection.send(message);
iq = $iq({to: "localhost", type: "get", id: "disco1"}).c("query", {xmlns:
"http://jabber.org/protocol/disco#info"});
connection.send(iq);
Why do we seem to find duplicate in Message Archive
Management backend ?
• When thinking about XMPP protocol, you need to think in federated context:
• Two XMPP domains can connect have have user chat between both domains.
• Message is stored once per user as archive can be managed independently (delete entry, etc)
Domain 1
Archive Archive
Domain 2User1 User2
See you at next

Weitere ähnliche Inhalte

Was ist angesagt?

Fighting XMPP abuse and spam with ejabberd - ejabberd Workshop #1
Fighting XMPP abuse and spam with ejabberd - ejabberd Workshop #1Fighting XMPP abuse and spam with ejabberd - ejabberd Workshop #1
Fighting XMPP abuse and spam with ejabberd - ejabberd Workshop #1Mickaël Rémond
 
Apache Kafka
Apache KafkaApache Kafka
Apache Kafkaemreakis
 
Practical solutions for connections administrators
Practical solutions for connections administratorsPractical solutions for connections administrators
Practical solutions for connections administratorsSharon James
 
Narayana 5: The premier open source transaction manager
Narayana 5: The premier open source transaction manager Narayana 5: The premier open source transaction manager
Narayana 5: The premier open source transaction manager Virtual JBoss User Group
 
MNPHP Scalable Architecture 101 - Feb 3 2011
MNPHP Scalable Architecture 101 - Feb 3 2011MNPHP Scalable Architecture 101 - Feb 3 2011
MNPHP Scalable Architecture 101 - Feb 3 2011Mike Willbanks
 
Connections install in 45 mins
Connections install in 45 minsConnections install in 45 mins
Connections install in 45 minsSharon James
 
NoSQL afternoon in Japan Kumofs & MessagePack
NoSQL afternoon in Japan Kumofs & MessagePackNoSQL afternoon in Japan Kumofs & MessagePack
NoSQL afternoon in Japan Kumofs & MessagePackSadayuki Furuhashi
 
HTTP - The Other Face Of Domino
HTTP - The Other Face Of DominoHTTP - The Other Face Of Domino
HTTP - The Other Face Of DominoGabriella Davis
 
Apache Kafka
Apache KafkaApache Kafka
Apache KafkaJoe Stein
 
Apache james more than emails in the cloud
Apache james  more than emails in the cloudApache james  more than emails in the cloud
Apache james more than emails in the cloudIoan Eugen Stan
 
Introduction to Kafka and Zookeeper
Introduction to Kafka and ZookeeperIntroduction to Kafka and Zookeeper
Introduction to Kafka and ZookeeperRahul Jain
 
Kafka Tutorial - basics of the Kafka streaming platform
Kafka Tutorial - basics of the Kafka streaming platformKafka Tutorial - basics of the Kafka streaming platform
Kafka Tutorial - basics of the Kafka streaming platformJean-Paul Azar
 
Practical solutions for connections administrators lite
Practical solutions for connections administrators litePractical solutions for connections administrators lite
Practical solutions for connections administrators liteSharon James
 
Mule Script Transformer
Mule Script TransformerMule Script Transformer
Mule Script TransformerAnkush Sharma
 

Was ist angesagt? (20)

Fighting XMPP abuse and spam with ejabberd - ejabberd Workshop #1
Fighting XMPP abuse and spam with ejabberd - ejabberd Workshop #1Fighting XMPP abuse and spam with ejabberd - ejabberd Workshop #1
Fighting XMPP abuse and spam with ejabberd - ejabberd Workshop #1
 
Art Of Message Queues
Art Of Message QueuesArt Of Message Queues
Art Of Message Queues
 
Apache kafka
Apache kafkaApache kafka
Apache kafka
 
Apache kafka
Apache kafkaApache kafka
Apache kafka
 
Apache Kafka
Apache KafkaApache Kafka
Apache Kafka
 
Practical solutions for connections administrators
Practical solutions for connections administratorsPractical solutions for connections administrators
Practical solutions for connections administrators
 
Noit ocon-2010
Noit ocon-2010Noit ocon-2010
Noit ocon-2010
 
Narayana 5: The premier open source transaction manager
Narayana 5: The premier open source transaction manager Narayana 5: The premier open source transaction manager
Narayana 5: The premier open source transaction manager
 
MNPHP Scalable Architecture 101 - Feb 3 2011
MNPHP Scalable Architecture 101 - Feb 3 2011MNPHP Scalable Architecture 101 - Feb 3 2011
MNPHP Scalable Architecture 101 - Feb 3 2011
 
Connections install in 45 mins
Connections install in 45 minsConnections install in 45 mins
Connections install in 45 mins
 
NoSQL afternoon in Japan Kumofs & MessagePack
NoSQL afternoon in Japan Kumofs & MessagePackNoSQL afternoon in Japan Kumofs & MessagePack
NoSQL afternoon in Japan Kumofs & MessagePack
 
HTTP - The Other Face Of Domino
HTTP - The Other Face Of DominoHTTP - The Other Face Of Domino
HTTP - The Other Face Of Domino
 
Apache James/Hupa & GWT
Apache James/Hupa & GWTApache James/Hupa & GWT
Apache James/Hupa & GWT
 
Apache Kafka
Apache KafkaApache Kafka
Apache Kafka
 
What's New in WildFly 9?
What's New in WildFly 9?What's New in WildFly 9?
What's New in WildFly 9?
 
Apache james more than emails in the cloud
Apache james  more than emails in the cloudApache james  more than emails in the cloud
Apache james more than emails in the cloud
 
Introduction to Kafka and Zookeeper
Introduction to Kafka and ZookeeperIntroduction to Kafka and Zookeeper
Introduction to Kafka and Zookeeper
 
Kafka Tutorial - basics of the Kafka streaming platform
Kafka Tutorial - basics of the Kafka streaming platformKafka Tutorial - basics of the Kafka streaming platform
Kafka Tutorial - basics of the Kafka streaming platform
 
Practical solutions for connections administrators lite
Practical solutions for connections administrators litePractical solutions for connections administrators lite
Practical solutions for connections administrators lite
 
Mule Script Transformer
Mule Script TransformerMule Script Transformer
Mule Script Transformer
 

Ähnlich wie XMPP Academy #3

The Real World - Plugging the Enterprise Into It (nodejs)
The Real World - Plugging  the Enterprise Into It (nodejs)The Real World - Plugging  the Enterprise Into It (nodejs)
The Real World - Plugging the Enterprise Into It (nodejs)Aman Kohli
 
AD113 Speed Up Your Applications w/ Nginx and PageSpeed
AD113  Speed Up Your Applications w/ Nginx and PageSpeedAD113  Speed Up Your Applications w/ Nginx and PageSpeed
AD113 Speed Up Your Applications w/ Nginx and PageSpeededm00se
 
Being HAPI! Reverse Proxying on Purpose
Being HAPI! Reverse Proxying on PurposeBeing HAPI! Reverse Proxying on Purpose
Being HAPI! Reverse Proxying on PurposeAman Kohli
 
The Art of Message Queues - TEKX
The Art of Message Queues - TEKXThe Art of Message Queues - TEKX
The Art of Message Queues - TEKXMike Willbanks
 
3 Tips to Deliver Fast Performance Across Mobile Web
3 Tips to Deliver Fast Performance Across Mobile Web3 Tips to Deliver Fast Performance Across Mobile Web
3 Tips to Deliver Fast Performance Across Mobile WebDynatrace
 
Software Architectures, Week 4 - Message-based Architectures, Message Bus
Software Architectures, Week 4 - Message-based Architectures, Message BusSoftware Architectures, Week 4 - Message-based Architectures, Message Bus
Software Architectures, Week 4 - Message-based Architectures, Message BusAngelos Kapsimanis
 
2nd AMIMOTO: WordPress + Amazon Web Services Singapore
2nd AMIMOTO: WordPress + Amazon Web Services Singapore2nd AMIMOTO: WordPress + Amazon Web Services Singapore
2nd AMIMOTO: WordPress + Amazon Web Services SingaporeKel
 
AWS re:Invent 2016: Amazon CloudFront Flash Talks: Best Practices on Configur...
AWS re:Invent 2016: Amazon CloudFront Flash Talks: Best Practices on Configur...AWS re:Invent 2016: Amazon CloudFront Flash Talks: Best Practices on Configur...
AWS re:Invent 2016: Amazon CloudFront Flash Talks: Best Practices on Configur...Amazon Web Services
 
Why we choose Symfony2
Why we choose Symfony2Why we choose Symfony2
Why we choose Symfony2Merixstudio
 
Silverlight vs HTML5 - Lessons learned from the real world...
Silverlight vs HTML5 - Lessons learned from the real world...Silverlight vs HTML5 - Lessons learned from the real world...
Silverlight vs HTML5 - Lessons learned from the real world...Peter Gfader
 
Fronteers 20131205 the realtime web
Fronteers 20131205   the realtime webFronteers 20131205   the realtime web
Fronteers 20131205 the realtime webBert Wijnants
 
Writing a Fullstack Application with Javascript - Remote media player
Writing a Fullstack Application with Javascript - Remote media playerWriting a Fullstack Application with Javascript - Remote media player
Writing a Fullstack Application with Javascript - Remote media playerTikal Knowledge
 
Iphone client-server app with Rails backend (v3)
Iphone client-server app with Rails backend (v3)Iphone client-server app with Rails backend (v3)
Iphone client-server app with Rails backend (v3)Sujee Maniyam
 
IoT with SignalR & .NET Gadgeteer - NetMF@Work
IoT with SignalR & .NET Gadgeteer - NetMF@WorkIoT with SignalR & .NET Gadgeteer - NetMF@Work
IoT with SignalR & .NET Gadgeteer - NetMF@WorkMirco Vanini
 
Monitoring and tuning your chef server - chef conf talk
Monitoring and tuning your chef server - chef conf talk Monitoring and tuning your chef server - chef conf talk
Monitoring and tuning your chef server - chef conf talk Andrew DuFour
 
AMIMOTO: WordPress + Amazon Web Services University of the Philippines Los Baños
AMIMOTO: WordPress + Amazon Web Services University of the Philippines Los BañosAMIMOTO: WordPress + Amazon Web Services University of the Philippines Los Baños
AMIMOTO: WordPress + Amazon Web Services University of the Philippines Los BañosKel
 
Advanced nginx in mercari - How to handle over 1,200,000 HTTPS Reqs/Min
Advanced nginx in mercari - How to handle over 1,200,000 HTTPS Reqs/MinAdvanced nginx in mercari - How to handle over 1,200,000 HTTPS Reqs/Min
Advanced nginx in mercari - How to handle over 1,200,000 HTTPS Reqs/MinMasahiro Nagano
 
Real-World Pulsar Architectural Patterns
Real-World Pulsar Architectural PatternsReal-World Pulsar Architectural Patterns
Real-World Pulsar Architectural PatternsDevin Bost
 

Ähnlich wie XMPP Academy #3 (20)

The Real World - Plugging the Enterprise Into It (nodejs)
The Real World - Plugging  the Enterprise Into It (nodejs)The Real World - Plugging  the Enterprise Into It (nodejs)
The Real World - Plugging the Enterprise Into It (nodejs)
 
AD113 Speed Up Your Applications w/ Nginx and PageSpeed
AD113  Speed Up Your Applications w/ Nginx and PageSpeedAD113  Speed Up Your Applications w/ Nginx and PageSpeed
AD113 Speed Up Your Applications w/ Nginx and PageSpeed
 
Being HAPI! Reverse Proxying on Purpose
Being HAPI! Reverse Proxying on PurposeBeing HAPI! Reverse Proxying on Purpose
Being HAPI! Reverse Proxying on Purpose
 
The Art of Message Queues - TEKX
The Art of Message Queues - TEKXThe Art of Message Queues - TEKX
The Art of Message Queues - TEKX
 
3 Tips to Deliver Fast Performance Across Mobile Web
3 Tips to Deliver Fast Performance Across Mobile Web3 Tips to Deliver Fast Performance Across Mobile Web
3 Tips to Deliver Fast Performance Across Mobile Web
 
Software Architectures, Week 4 - Message-based Architectures, Message Bus
Software Architectures, Week 4 - Message-based Architectures, Message BusSoftware Architectures, Week 4 - Message-based Architectures, Message Bus
Software Architectures, Week 4 - Message-based Architectures, Message Bus
 
2nd AMIMOTO: WordPress + Amazon Web Services Singapore
2nd AMIMOTO: WordPress + Amazon Web Services Singapore2nd AMIMOTO: WordPress + Amazon Web Services Singapore
2nd AMIMOTO: WordPress + Amazon Web Services Singapore
 
AWS re:Invent 2016: Amazon CloudFront Flash Talks: Best Practices on Configur...
AWS re:Invent 2016: Amazon CloudFront Flash Talks: Best Practices on Configur...AWS re:Invent 2016: Amazon CloudFront Flash Talks: Best Practices on Configur...
AWS re:Invent 2016: Amazon CloudFront Flash Talks: Best Practices on Configur...
 
Signal R 2015
Signal R 2015Signal R 2015
Signal R 2015
 
Why we choose Symfony2
Why we choose Symfony2Why we choose Symfony2
Why we choose Symfony2
 
Silverlight vs HTML5 - Lessons learned from the real world...
Silverlight vs HTML5 - Lessons learned from the real world...Silverlight vs HTML5 - Lessons learned from the real world...
Silverlight vs HTML5 - Lessons learned from the real world...
 
Fronteers 20131205 the realtime web
Fronteers 20131205   the realtime webFronteers 20131205   the realtime web
Fronteers 20131205 the realtime web
 
Writing a Fullstack Application with Javascript - Remote media player
Writing a Fullstack Application with Javascript - Remote media playerWriting a Fullstack Application with Javascript - Remote media player
Writing a Fullstack Application with Javascript - Remote media player
 
Iphone client-server app with Rails backend (v3)
Iphone client-server app with Rails backend (v3)Iphone client-server app with Rails backend (v3)
Iphone client-server app with Rails backend (v3)
 
IoT with SignalR & .NET Gadgeteer - NetMF@Work
IoT with SignalR & .NET Gadgeteer - NetMF@WorkIoT with SignalR & .NET Gadgeteer - NetMF@Work
IoT with SignalR & .NET Gadgeteer - NetMF@Work
 
Monitoring and tuning your chef server - chef conf talk
Monitoring and tuning your chef server - chef conf talk Monitoring and tuning your chef server - chef conf talk
Monitoring and tuning your chef server - chef conf talk
 
AMIMOTO: WordPress + Amazon Web Services University of the Philippines Los Baños
AMIMOTO: WordPress + Amazon Web Services University of the Philippines Los BañosAMIMOTO: WordPress + Amazon Web Services University of the Philippines Los Baños
AMIMOTO: WordPress + Amazon Web Services University of the Philippines Los Baños
 
Advanced nginx in mercari - How to handle over 1,200,000 HTTPS Reqs/Min
Advanced nginx in mercari - How to handle over 1,200,000 HTTPS Reqs/MinAdvanced nginx in mercari - How to handle over 1,200,000 HTTPS Reqs/Min
Advanced nginx in mercari - How to handle over 1,200,000 HTTPS Reqs/Min
 
presentation slides
presentation slidespresentation slides
presentation slides
 
Real-World Pulsar Architectural Patterns
Real-World Pulsar Architectural PatternsReal-World Pulsar Architectural Patterns
Real-World Pulsar Architectural Patterns
 

Mehr von Mickaël Rémond

Go for Real Time Streaming Architectures - DotGo 2017
Go for Real Time Streaming Architectures - DotGo 2017Go for Real Time Streaming Architectures - DotGo 2017
Go for Real Time Streaming Architectures - DotGo 2017Mickaël Rémond
 
Phoenix Presence: Le service temps réel de Phoenix - Paris.ex #8
Phoenix Presence: Le service temps réel de Phoenix - Paris.ex #8 Phoenix Presence: Le service temps réel de Phoenix - Paris.ex #8
Phoenix Presence: Le service temps réel de Phoenix - Paris.ex #8 Mickaël Rémond
 
Messaging temps réel avec Go
Messaging temps réel avec GoMessaging temps réel avec Go
Messaging temps réel avec GoMickaël Rémond
 
Building Scalable Systems: What you can learn from Erlang - DotScale 2016
Building Scalable Systems: What you can learn from Erlang - DotScale 2016Building Scalable Systems: What you can learn from Erlang - DotScale 2016
Building Scalable Systems: What you can learn from Erlang - DotScale 2016Mickaël Rémond
 
Property-based testing of XMPP: generate your tests automatically - ejabberd ...
Property-based testing of XMPP: generate your tests automatically - ejabberd ...Property-based testing of XMPP: generate your tests automatically - ejabberd ...
Property-based testing of XMPP: generate your tests automatically - ejabberd ...Mickaël Rémond
 
Deep Dive Into ejabberd Pubsub Implementation
Deep Dive Into ejabberd Pubsub ImplementationDeep Dive Into ejabberd Pubsub Implementation
Deep Dive Into ejabberd Pubsub ImplementationMickaël Rémond
 
2015: L'année d'Elixir, Code, écosystème et communauté
2015: L'année d'Elixir, Code, écosystème et communauté2015: L'année d'Elixir, Code, écosystème et communauté
2015: L'année d'Elixir, Code, écosystème et communautéMickaël Rémond
 
WaveOne server and client by ProcessOne
WaveOne server and client by ProcessOneWaveOne server and client by ProcessOne
WaveOne server and client by ProcessOneMickaël Rémond
 
Real time Web Application with XMPP and Wave
Real time Web Application with XMPP and WaveReal time Web Application with XMPP and Wave
Real time Web Application with XMPP and WaveMickaël Rémond
 
Real life XMPP Instant Messaging
Real life XMPP Instant MessagingReal life XMPP Instant Messaging
Real life XMPP Instant MessagingMickaël Rémond
 

Mehr von Mickaël Rémond (14)

Go for Real Time Streaming Architectures - DotGo 2017
Go for Real Time Streaming Architectures - DotGo 2017Go for Real Time Streaming Architectures - DotGo 2017
Go for Real Time Streaming Architectures - DotGo 2017
 
Phoenix Presence: Le service temps réel de Phoenix - Paris.ex #8
Phoenix Presence: Le service temps réel de Phoenix - Paris.ex #8 Phoenix Presence: Le service temps réel de Phoenix - Paris.ex #8
Phoenix Presence: Le service temps réel de Phoenix - Paris.ex #8
 
Messaging temps réel avec Go
Messaging temps réel avec GoMessaging temps réel avec Go
Messaging temps réel avec Go
 
Building Scalable Systems: What you can learn from Erlang - DotScale 2016
Building Scalable Systems: What you can learn from Erlang - DotScale 2016Building Scalable Systems: What you can learn from Erlang - DotScale 2016
Building Scalable Systems: What you can learn from Erlang - DotScale 2016
 
Property-based testing of XMPP: generate your tests automatically - ejabberd ...
Property-based testing of XMPP: generate your tests automatically - ejabberd ...Property-based testing of XMPP: generate your tests automatically - ejabberd ...
Property-based testing of XMPP: generate your tests automatically - ejabberd ...
 
Deep Dive Into ejabberd Pubsub Implementation
Deep Dive Into ejabberd Pubsub ImplementationDeep Dive Into ejabberd Pubsub Implementation
Deep Dive Into ejabberd Pubsub Implementation
 
2015: L'année d'Elixir, Code, écosystème et communauté
2015: L'année d'Elixir, Code, écosystème et communauté2015: L'année d'Elixir, Code, écosystème et communauté
2015: L'année d'Elixir, Code, écosystème et communauté
 
Multitasking in iOS 7
Multitasking in iOS 7Multitasking in iOS 7
Multitasking in iOS 7
 
WaveOne server and client by ProcessOne
WaveOne server and client by ProcessOneWaveOne server and client by ProcessOne
WaveOne server and client by ProcessOne
 
Real time Web Application with XMPP and Wave
Real time Web Application with XMPP and WaveReal time Web Application with XMPP and Wave
Real time Web Application with XMPP and Wave
 
Erlang White Label
Erlang White LabelErlang White Label
Erlang White Label
 
OneTeam Media Server
OneTeam Media ServerOneTeam Media Server
OneTeam Media Server
 
OneTeam Media Server
OneTeam Media ServerOneTeam Media Server
OneTeam Media Server
 
Real life XMPP Instant Messaging
Real life XMPP Instant MessagingReal life XMPP Instant Messaging
Real life XMPP Instant Messaging
 

Kürzlich hochgeladen

CNIC Information System with Pakdata Cf In Pakistan
CNIC Information System with Pakdata Cf In PakistanCNIC Information System with Pakdata Cf In Pakistan
CNIC Information System with Pakdata Cf In Pakistandanishmna97
 
Finding Java's Hidden Performance Traps @ DevoxxUK 2024
Finding Java's Hidden Performance Traps @ DevoxxUK 2024Finding Java's Hidden Performance Traps @ DevoxxUK 2024
Finding Java's Hidden Performance Traps @ DevoxxUK 2024Victor Rentea
 
Strategize a Smooth Tenant-to-tenant Migration and Copilot Takeoff
Strategize a Smooth Tenant-to-tenant Migration and Copilot TakeoffStrategize a Smooth Tenant-to-tenant Migration and Copilot Takeoff
Strategize a Smooth Tenant-to-tenant Migration and Copilot Takeoffsammart93
 
Connector Corner: Accelerate revenue generation using UiPath API-centric busi...
Connector Corner: Accelerate revenue generation using UiPath API-centric busi...Connector Corner: Accelerate revenue generation using UiPath API-centric busi...
Connector Corner: Accelerate revenue generation using UiPath API-centric busi...DianaGray10
 
Six Myths about Ontologies: The Basics of Formal Ontology
Six Myths about Ontologies: The Basics of Formal OntologySix Myths about Ontologies: The Basics of Formal Ontology
Six Myths about Ontologies: The Basics of Formal Ontologyjohnbeverley2021
 
Biography Of Angeliki Cooney | Senior Vice President Life Sciences | Albany, ...
Biography Of Angeliki Cooney | Senior Vice President Life Sciences | Albany, ...Biography Of Angeliki Cooney | Senior Vice President Life Sciences | Albany, ...
Biography Of Angeliki Cooney | Senior Vice President Life Sciences | Albany, ...Angeliki Cooney
 
Exploring Multimodal Embeddings with Milvus
Exploring Multimodal Embeddings with MilvusExploring Multimodal Embeddings with Milvus
Exploring Multimodal Embeddings with MilvusZilliz
 
Polkadot JAM Slides - Token2049 - By Dr. Gavin Wood
Polkadot JAM Slides - Token2049 - By Dr. Gavin WoodPolkadot JAM Slides - Token2049 - By Dr. Gavin Wood
Polkadot JAM Slides - Token2049 - By Dr. Gavin WoodJuan lago vázquez
 
Architecting Cloud Native Applications
Architecting Cloud Native ApplicationsArchitecting Cloud Native Applications
Architecting Cloud Native ApplicationsWSO2
 
Apidays New York 2024 - Accelerating FinTech Innovation by Vasa Krishnan, Fin...
Apidays New York 2024 - Accelerating FinTech Innovation by Vasa Krishnan, Fin...Apidays New York 2024 - Accelerating FinTech Innovation by Vasa Krishnan, Fin...
Apidays New York 2024 - Accelerating FinTech Innovation by Vasa Krishnan, Fin...apidays
 
Platformless Horizons for Digital Adaptability
Platformless Horizons for Digital AdaptabilityPlatformless Horizons for Digital Adaptability
Platformless Horizons for Digital AdaptabilityWSO2
 
Apidays New York 2024 - Passkeys: Developing APIs to enable passwordless auth...
Apidays New York 2024 - Passkeys: Developing APIs to enable passwordless auth...Apidays New York 2024 - Passkeys: Developing APIs to enable passwordless auth...
Apidays New York 2024 - Passkeys: Developing APIs to enable passwordless auth...apidays
 
Rising Above_ Dubai Floods and the Fortitude of Dubai International Airport.pdf
Rising Above_ Dubai Floods and the Fortitude of Dubai International Airport.pdfRising Above_ Dubai Floods and the Fortitude of Dubai International Airport.pdf
Rising Above_ Dubai Floods and the Fortitude of Dubai International Airport.pdfOrbitshub
 
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers:  A Deep Dive into Serverless Spatial Data and FMECloud Frontiers:  A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FMESafe Software
 
TrustArc Webinar - Unlock the Power of AI-Driven Data Discovery
TrustArc Webinar - Unlock the Power of AI-Driven Data DiscoveryTrustArc Webinar - Unlock the Power of AI-Driven Data Discovery
TrustArc Webinar - Unlock the Power of AI-Driven Data DiscoveryTrustArc
 
Apidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, Adobe
Apidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, AdobeApidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, Adobe
Apidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, Adobeapidays
 
Why Teams call analytics are critical to your entire business
Why Teams call analytics are critical to your entire businessWhy Teams call analytics are critical to your entire business
Why Teams call analytics are critical to your entire businesspanagenda
 
How to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected WorkerHow to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected WorkerThousandEyes
 
Apidays New York 2024 - The Good, the Bad and the Governed by David O'Neill, ...
Apidays New York 2024 - The Good, the Bad and the Governed by David O'Neill, ...Apidays New York 2024 - The Good, the Bad and the Governed by David O'Neill, ...
Apidays New York 2024 - The Good, the Bad and the Governed by David O'Neill, ...apidays
 

Kürzlich hochgeladen (20)

CNIC Information System with Pakdata Cf In Pakistan
CNIC Information System with Pakdata Cf In PakistanCNIC Information System with Pakdata Cf In Pakistan
CNIC Information System with Pakdata Cf In Pakistan
 
Finding Java's Hidden Performance Traps @ DevoxxUK 2024
Finding Java's Hidden Performance Traps @ DevoxxUK 2024Finding Java's Hidden Performance Traps @ DevoxxUK 2024
Finding Java's Hidden Performance Traps @ DevoxxUK 2024
 
Strategize a Smooth Tenant-to-tenant Migration and Copilot Takeoff
Strategize a Smooth Tenant-to-tenant Migration and Copilot TakeoffStrategize a Smooth Tenant-to-tenant Migration and Copilot Takeoff
Strategize a Smooth Tenant-to-tenant Migration and Copilot Takeoff
 
Connector Corner: Accelerate revenue generation using UiPath API-centric busi...
Connector Corner: Accelerate revenue generation using UiPath API-centric busi...Connector Corner: Accelerate revenue generation using UiPath API-centric busi...
Connector Corner: Accelerate revenue generation using UiPath API-centric busi...
 
Six Myths about Ontologies: The Basics of Formal Ontology
Six Myths about Ontologies: The Basics of Formal OntologySix Myths about Ontologies: The Basics of Formal Ontology
Six Myths about Ontologies: The Basics of Formal Ontology
 
Understanding the FAA Part 107 License ..
Understanding the FAA Part 107 License ..Understanding the FAA Part 107 License ..
Understanding the FAA Part 107 License ..
 
Biography Of Angeliki Cooney | Senior Vice President Life Sciences | Albany, ...
Biography Of Angeliki Cooney | Senior Vice President Life Sciences | Albany, ...Biography Of Angeliki Cooney | Senior Vice President Life Sciences | Albany, ...
Biography Of Angeliki Cooney | Senior Vice President Life Sciences | Albany, ...
 
Exploring Multimodal Embeddings with Milvus
Exploring Multimodal Embeddings with MilvusExploring Multimodal Embeddings with Milvus
Exploring Multimodal Embeddings with Milvus
 
Polkadot JAM Slides - Token2049 - By Dr. Gavin Wood
Polkadot JAM Slides - Token2049 - By Dr. Gavin WoodPolkadot JAM Slides - Token2049 - By Dr. Gavin Wood
Polkadot JAM Slides - Token2049 - By Dr. Gavin Wood
 
Architecting Cloud Native Applications
Architecting Cloud Native ApplicationsArchitecting Cloud Native Applications
Architecting Cloud Native Applications
 
Apidays New York 2024 - Accelerating FinTech Innovation by Vasa Krishnan, Fin...
Apidays New York 2024 - Accelerating FinTech Innovation by Vasa Krishnan, Fin...Apidays New York 2024 - Accelerating FinTech Innovation by Vasa Krishnan, Fin...
Apidays New York 2024 - Accelerating FinTech Innovation by Vasa Krishnan, Fin...
 
Platformless Horizons for Digital Adaptability
Platformless Horizons for Digital AdaptabilityPlatformless Horizons for Digital Adaptability
Platformless Horizons for Digital Adaptability
 
Apidays New York 2024 - Passkeys: Developing APIs to enable passwordless auth...
Apidays New York 2024 - Passkeys: Developing APIs to enable passwordless auth...Apidays New York 2024 - Passkeys: Developing APIs to enable passwordless auth...
Apidays New York 2024 - Passkeys: Developing APIs to enable passwordless auth...
 
Rising Above_ Dubai Floods and the Fortitude of Dubai International Airport.pdf
Rising Above_ Dubai Floods and the Fortitude of Dubai International Airport.pdfRising Above_ Dubai Floods and the Fortitude of Dubai International Airport.pdf
Rising Above_ Dubai Floods and the Fortitude of Dubai International Airport.pdf
 
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers:  A Deep Dive into Serverless Spatial Data and FMECloud Frontiers:  A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FME
 
TrustArc Webinar - Unlock the Power of AI-Driven Data Discovery
TrustArc Webinar - Unlock the Power of AI-Driven Data DiscoveryTrustArc Webinar - Unlock the Power of AI-Driven Data Discovery
TrustArc Webinar - Unlock the Power of AI-Driven Data Discovery
 
Apidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, Adobe
Apidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, AdobeApidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, Adobe
Apidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, Adobe
 
Why Teams call analytics are critical to your entire business
Why Teams call analytics are critical to your entire businessWhy Teams call analytics are critical to your entire business
Why Teams call analytics are critical to your entire business
 
How to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected WorkerHow to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected Worker
 
Apidays New York 2024 - The Good, the Bad and the Governed by David O'Neill, ...
Apidays New York 2024 - The Good, the Bad and the Governed by David O'Neill, ...Apidays New York 2024 - The Good, the Bad and the Governed by David O'Neill, ...
Apidays New York 2024 - The Good, the Bad and the Governed by David O'Neill, ...
 

XMPP Academy #3

  • 1. Academy #3 16th November 2015 Mickaël Rémond, @mickael
  • 2. Questions ejabberd questions • How does Apple and Google Push support work on ejabberd SaaS and ejabberd Business Edition ? • What is the relationship between ejabberd Push support and XEP-0357: Push Notifications ? XMPP questions • What is the impact of Websocket on Web chat performance ? • What is the XMPP stack for quick prototyping ? • Why do we seem to find duplicate in Message Archive Management backend ?
  • 3. What are Push Notifications and why do they matter ? • Most smartphones Operating Systems are saving battery life by preventing apps to run constantly and access network in background: • On iOS, since iOS 3. • On Android since Android 6. • For a chat application, it means that: • your application is suspended shortly after user put it to background. • as a result you cannot directly receive messages. => You need an OS provider service that will awake your app when there is message available for you on ejabberd.
  • 6. Push app+device are identified with token ejabberd Push
  • 7. ejabberd support for Push • ejabberd SaaS and Business Edition natively support push notifications. • Prerequisite for ejabberd configuration: • iOS: • App ID • APNS sandbox and production certificates • Android: • Application package name • API Key • Prerequisite on client-side: • iOS: Retrieve or update Device Token. • Android: Retrieve or update Registration ID
  • 8. ejabberd support for Push • Client configuration is done with IQ stanza in the XMPP stream, after authentication. <iq type='set' id='123'> <push xmlns='p1:push' apn-sandbox='false'> <keepalive max="30"/> <session duration="60"/> <body send="all" groupchat="true" from="jid"/> <status type="xa">Text Message when in push mode</status> <offline>false</offline> <notification> <type>applepush</type> <id>DeviceToken</id> </notification> <appid>application1</appid> </push> </iq>
  • 9. iOS notification sub elements <iq type='set' id='123'> <push xmlns='p1:push' apn-sandbox='false'> <appid>AppID</appid> <notification> <type>applepush</type> <id>DeviceToken</id> </notification> … </push> </iq>
  • 10. Android notification sub elements <iq type='set' id='123'> <push xmlns='p1:push' apn-sandbox='false'> <appid>ApplicationPackageName</appid> <notification> <type>gcm</type> <id>RegistrationID</id> </notification> … </push> </iq>
  • 11. ejabberd push triggers • Message received while session is detached or user is offline. • Groupchat messages while user session is running and possibly detached (optional) • Badges: Automatic support for message counts. Auto reset on login.
  • 13. Push setting customisations: Per sender sound <iq type="set" id="cust1"> <customize xmlns="p1:push:customize"> <item from="adam@example.com" mute="true"/> <item from="eve@example.com" sound="horn.wav"/> </customize> </iq>
  • 14. Per message customisation Custom fields in messages: • This could allow clients to taylor rendering: <message> ... <x xmlns="p1:push:custom" key="AAA" value="BBB"> ... </message>
  • 15. Per message customisation Per message sound customization: <message type="chat" from="peer@example.com"> <body>Hello!</body> <customize xmlns="p1:push:customize" sound="2.wav"/> </message> Or mute: <message type="chat" from="peer@example.com"> <body>System message: ...</body> <customize xmlns="p1:push:customize" mute="true"/> </message>
  • 16. Per message customisation Customise body and nick displayed: <message type="chat" from="peer@example.com"> <body>{matchResult: "2:1", Players: [...]}</body> <customize xmlns="p1:push:customize" nick="SportBot"> <body>Match result update 2:1 for ...</body> </customize> </message>
  • 17. Support for silent pushes • Silent pushes are intended for the app only. • They provide metadata for the app and can trigger background processing without displaying an alert to the user. • Useful to trigger background synchronisation when data are available.
  • 18. Push Caveats • Groupchat notifications are only possible when user is online or session is running on server in detached mode. • => We are adding feature to groupchat to dealt with that part. • Apple Push buffer only contains one message: • Do not expected to never miss a push: If your phone is turn off, you will only receive the latest push when turned off. • If this was a silent push, nothing will be visible to the user.
  • 19. What is the relationship between ejabberd Push support and XEP-0357: Push Notifications ? • They cover different use cases: • XEP-0357 defines: • a way for app devices to pass their push credential to service. • a standard API to trigger push notification from XMPP packets. • XEP-0357 does not define the triggers: • When and what the server is supposed to do to send push notifications to users. • It assumes that it is mostly used by third-party services or component to send pushes. • Our push approach fills the gap between: • Server events that should trigger push notification, along with the format of such notifications. • Actually sending the push to the device manufacturer push service.
  • 20. What is the impact of Websocket on Web chat performance ? • On server, Websocket is a much more efficient protocol that takes less resources. • However, impact on latency is directly visible on client.
  • 21.
  • 22. Measurement of time to open session: Bosh vs Websocket • On server, Websocket is a much more efficient protocol that takes less resources. • However, impact on latency is directly visible on client. • Bosh (localhost, no SSL): 1428ms • Websocket (localhost, no SSL): 307ms • Bosh (remote server, SSL): 2198ms • Websocket (remote server, SSL): 1446ms • The more roundtrip you have, the more impact: • Websocket is much better when there is a lot of interactions: Discovery, forms, server configuration, etc.
  • 23. What is the XMPP stack for quick prototyping ? • Versatile and widely used server: ejabberd • Client stack: • Android: Smack 4 • iOS: XMPPFramework • Web: Strophe
  • 24. Using Strophe for prototyping / learning XMPP and experimenting • With a basic client, you can use the JS console to prepare and send XMPP packets: presence = $pres(); connection.send(presence); presence = $pres().c("status").t("away"); connection.send(presence); message = $msg({to: "test@localhost", type: "chat"}).c("body").t("Hello XMPP Academy !"); connection.send(message); iq = $iq({to: "localhost", type: "get", id: "disco1"}).c("query", {xmlns: "http://jabber.org/protocol/disco#info"}); connection.send(iq);
  • 25.
  • 26. Why do we seem to find duplicate in Message Archive Management backend ? • When thinking about XMPP protocol, you need to think in federated context: • Two XMPP domains can connect have have user chat between both domains. • Message is stored once per user as archive can be managed independently (delete entry, etc)
  • 28. See you at next