SlideShare a Scribd company logo
1 of 28
Download to read offline
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

More Related Content

What's hot

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
 

What's hot (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
 

Similar to 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
 

Similar to 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
 

More from 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
 

More from 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
 

Recently uploaded

Automating Business Process via MuleSoft Composer | Bangalore MuleSoft Meetup...
Automating Business Process via MuleSoft Composer | Bangalore MuleSoft Meetup...Automating Business Process via MuleSoft Composer | Bangalore MuleSoft Meetup...
Automating Business Process via MuleSoft Composer | Bangalore MuleSoft Meetup...shyamraj55
 
#StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024
#StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024#StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024
#StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024BookNet Canada
 
"Federated learning: out of reach no matter how close",Oleksandr Lapshyn
"Federated learning: out of reach no matter how close",Oleksandr Lapshyn"Federated learning: out of reach no matter how close",Oleksandr Lapshyn
"Federated learning: out of reach no matter how close",Oleksandr LapshynFwdays
 
Integration and Automation in Practice: CI/CD in Mule Integration and Automat...
Integration and Automation in Practice: CI/CD in Mule Integration and Automat...Integration and Automation in Practice: CI/CD in Mule Integration and Automat...
Integration and Automation in Practice: CI/CD in Mule Integration and Automat...Patryk Bandurski
 
Pigging Solutions in Pet Food Manufacturing
Pigging Solutions in Pet Food ManufacturingPigging Solutions in Pet Food Manufacturing
Pigging Solutions in Pet Food ManufacturingPigging Solutions
 
Maximizing Board Effectiveness 2024 Webinar.pptx
Maximizing Board Effectiveness 2024 Webinar.pptxMaximizing Board Effectiveness 2024 Webinar.pptx
Maximizing Board Effectiveness 2024 Webinar.pptxOnBoard
 
Kotlin Multiplatform & Compose Multiplatform - Starter kit for pragmatics
Kotlin Multiplatform & Compose Multiplatform - Starter kit for pragmaticsKotlin Multiplatform & Compose Multiplatform - Starter kit for pragmatics
Kotlin Multiplatform & Compose Multiplatform - Starter kit for pragmaticscarlostorres15106
 
Unlocking the Potential of the Cloud for IBM Power Systems
Unlocking the Potential of the Cloud for IBM Power SystemsUnlocking the Potential of the Cloud for IBM Power Systems
Unlocking the Potential of the Cloud for IBM Power SystemsPrecisely
 
Benefits Of Flutter Compared To Other Frameworks
Benefits Of Flutter Compared To Other FrameworksBenefits Of Flutter Compared To Other Frameworks
Benefits Of Flutter Compared To Other FrameworksSoftradix Technologies
 
Pigging Solutions Piggable Sweeping Elbows
Pigging Solutions Piggable Sweeping ElbowsPigging Solutions Piggable Sweeping Elbows
Pigging Solutions Piggable Sweeping ElbowsPigging Solutions
 
Injustice - Developers Among Us (SciFiDevCon 2024)
Injustice - Developers Among Us (SciFiDevCon 2024)Injustice - Developers Among Us (SciFiDevCon 2024)
Injustice - Developers Among Us (SciFiDevCon 2024)Allon Mureinik
 
Tech-Forward - Achieving Business Readiness For Copilot in Microsoft 365
Tech-Forward - Achieving Business Readiness For Copilot in Microsoft 365Tech-Forward - Achieving Business Readiness For Copilot in Microsoft 365
Tech-Forward - Achieving Business Readiness For Copilot in Microsoft 3652toLead Limited
 
Build your next Gen AI Breakthrough - April 2024
Build your next Gen AI Breakthrough - April 2024Build your next Gen AI Breakthrough - April 2024
Build your next Gen AI Breakthrough - April 2024Neo4j
 
"LLMs for Python Engineers: Advanced Data Analysis and Semantic Kernel",Oleks...
"LLMs for Python Engineers: Advanced Data Analysis and Semantic Kernel",Oleks..."LLMs for Python Engineers: Advanced Data Analysis and Semantic Kernel",Oleks...
"LLMs for Python Engineers: Advanced Data Analysis and Semantic Kernel",Oleks...Fwdays
 
Beyond Boundaries: Leveraging No-Code Solutions for Industry Innovation
Beyond Boundaries: Leveraging No-Code Solutions for Industry InnovationBeyond Boundaries: Leveraging No-Code Solutions for Industry Innovation
Beyond Boundaries: Leveraging No-Code Solutions for Industry InnovationSafe Software
 
Human Factors of XR: Using Human Factors to Design XR Systems
Human Factors of XR: Using Human Factors to Design XR SystemsHuman Factors of XR: Using Human Factors to Design XR Systems
Human Factors of XR: Using Human Factors to Design XR SystemsMark Billinghurst
 
The Codex of Business Writing Software for Real-World Solutions 2.pptx
The Codex of Business Writing Software for Real-World Solutions 2.pptxThe Codex of Business Writing Software for Real-World Solutions 2.pptx
The Codex of Business Writing Software for Real-World Solutions 2.pptxMalak Abu Hammad
 
Swan(sea) Song – personal research during my six years at Swansea ... and bey...
Swan(sea) Song – personal research during my six years at Swansea ... and bey...Swan(sea) Song – personal research during my six years at Swansea ... and bey...
Swan(sea) Song – personal research during my six years at Swansea ... and bey...Alan Dix
 

Recently uploaded (20)

Automating Business Process via MuleSoft Composer | Bangalore MuleSoft Meetup...
Automating Business Process via MuleSoft Composer | Bangalore MuleSoft Meetup...Automating Business Process via MuleSoft Composer | Bangalore MuleSoft Meetup...
Automating Business Process via MuleSoft Composer | Bangalore MuleSoft Meetup...
 
#StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024
#StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024#StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024
#StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024
 
Vulnerability_Management_GRC_by Sohang Sengupta.pptx
Vulnerability_Management_GRC_by Sohang Sengupta.pptxVulnerability_Management_GRC_by Sohang Sengupta.pptx
Vulnerability_Management_GRC_by Sohang Sengupta.pptx
 
"Federated learning: out of reach no matter how close",Oleksandr Lapshyn
"Federated learning: out of reach no matter how close",Oleksandr Lapshyn"Federated learning: out of reach no matter how close",Oleksandr Lapshyn
"Federated learning: out of reach no matter how close",Oleksandr Lapshyn
 
The transition to renewables in India.pdf
The transition to renewables in India.pdfThe transition to renewables in India.pdf
The transition to renewables in India.pdf
 
Integration and Automation in Practice: CI/CD in Mule Integration and Automat...
Integration and Automation in Practice: CI/CD in Mule Integration and Automat...Integration and Automation in Practice: CI/CD in Mule Integration and Automat...
Integration and Automation in Practice: CI/CD in Mule Integration and Automat...
 
Pigging Solutions in Pet Food Manufacturing
Pigging Solutions in Pet Food ManufacturingPigging Solutions in Pet Food Manufacturing
Pigging Solutions in Pet Food Manufacturing
 
Maximizing Board Effectiveness 2024 Webinar.pptx
Maximizing Board Effectiveness 2024 Webinar.pptxMaximizing Board Effectiveness 2024 Webinar.pptx
Maximizing Board Effectiveness 2024 Webinar.pptx
 
Kotlin Multiplatform & Compose Multiplatform - Starter kit for pragmatics
Kotlin Multiplatform & Compose Multiplatform - Starter kit for pragmaticsKotlin Multiplatform & Compose Multiplatform - Starter kit for pragmatics
Kotlin Multiplatform & Compose Multiplatform - Starter kit for pragmatics
 
Unlocking the Potential of the Cloud for IBM Power Systems
Unlocking the Potential of the Cloud for IBM Power SystemsUnlocking the Potential of the Cloud for IBM Power Systems
Unlocking the Potential of the Cloud for IBM Power Systems
 
Benefits Of Flutter Compared To Other Frameworks
Benefits Of Flutter Compared To Other FrameworksBenefits Of Flutter Compared To Other Frameworks
Benefits Of Flutter Compared To Other Frameworks
 
Pigging Solutions Piggable Sweeping Elbows
Pigging Solutions Piggable Sweeping ElbowsPigging Solutions Piggable Sweeping Elbows
Pigging Solutions Piggable Sweeping Elbows
 
Injustice - Developers Among Us (SciFiDevCon 2024)
Injustice - Developers Among Us (SciFiDevCon 2024)Injustice - Developers Among Us (SciFiDevCon 2024)
Injustice - Developers Among Us (SciFiDevCon 2024)
 
Tech-Forward - Achieving Business Readiness For Copilot in Microsoft 365
Tech-Forward - Achieving Business Readiness For Copilot in Microsoft 365Tech-Forward - Achieving Business Readiness For Copilot in Microsoft 365
Tech-Forward - Achieving Business Readiness For Copilot in Microsoft 365
 
Build your next Gen AI Breakthrough - April 2024
Build your next Gen AI Breakthrough - April 2024Build your next Gen AI Breakthrough - April 2024
Build your next Gen AI Breakthrough - April 2024
 
"LLMs for Python Engineers: Advanced Data Analysis and Semantic Kernel",Oleks...
"LLMs for Python Engineers: Advanced Data Analysis and Semantic Kernel",Oleks..."LLMs for Python Engineers: Advanced Data Analysis and Semantic Kernel",Oleks...
"LLMs for Python Engineers: Advanced Data Analysis and Semantic Kernel",Oleks...
 
Beyond Boundaries: Leveraging No-Code Solutions for Industry Innovation
Beyond Boundaries: Leveraging No-Code Solutions for Industry InnovationBeyond Boundaries: Leveraging No-Code Solutions for Industry Innovation
Beyond Boundaries: Leveraging No-Code Solutions for Industry Innovation
 
Human Factors of XR: Using Human Factors to Design XR Systems
Human Factors of XR: Using Human Factors to Design XR SystemsHuman Factors of XR: Using Human Factors to Design XR Systems
Human Factors of XR: Using Human Factors to Design XR Systems
 
The Codex of Business Writing Software for Real-World Solutions 2.pptx
The Codex of Business Writing Software for Real-World Solutions 2.pptxThe Codex of Business Writing Software for Real-World Solutions 2.pptx
The Codex of Business Writing Software for Real-World Solutions 2.pptx
 
Swan(sea) Song – personal research during my six years at Swansea ... and bey...
Swan(sea) Song – personal research during my six years at Swansea ... and bey...Swan(sea) Song – personal research during my six years at Swansea ... and bey...
Swan(sea) Song – personal research during my six years at Swansea ... and bey...
 

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