Based on the Star Wars theme, this session focuses on how Java EE 7 provides an extensive set of new and enhanced features to support standards such as HTML5, WebSocket, and Server-sent events, among others. The session shows how these new features are designed and matched to work together for developing lightweight solutions matching end users’ high expectations for Web application responsiveness. It covers best practices and design patterns associating the technologies with analogies from Star Wars. So join me in this fun filled talk where technology meets science and innovation..
May the force be with you!
La presentazione tenuta da Simone Bordet in occasione del Codemotion Roma del 5 marzo 2011 - http://www.codemotion.it/
Si parlerà delle web applications di tipo Comet, cioè di quelle web applications che si occupano di notificare con latenza bassissima - di norma a browsers - eventi ricevuti dal server come stock price, eventi sportivi, giochi online, etc. La sessione proseguirà con una discussione sugli impatti che le applicazioni Comet hanno nello sviluppo e nel deployment, e con una panoramica sul nuovo protocollo WebSocket definito da HTML5 e sul progetto open source CometD.
This document discusses various Enterprise Application Integration centric designs or approaches which may be considered as better practices, and have been implemented in the data acquisition platform at Nielsen. Targeted audience is tech leaders and architects working across the platform. There is a special focus on leveraging open source technologies where possible. Hoping that some of the material here can help fellow architects.
Webinar slides "Building Real-Time Collaborative Web Applications"Sachin Katariya
Key Takeaways:
1> Key technology enablers for real-time collaboration
2> Supporting open source technologies such as Node.js, WebSocket and HTML5
3> Enriching user experience with real-time collaboration
4> Demonstration of a sample real-time collaborative web application
5> Performance benchmarks
HTTP requests and responses follow a generic message format that includes a start line, message headers, an optional message body, and optional trailers. The start line indicates the request method and URI for requests or the HTTP version and status code for responses. Headers provide additional metadata about the message, sender, recipient, or content. The body carries request data or response content. Trailers are rarely used and provide additional headers after chunked content.
4Developers 2018: Real-time capabilities in ASP.NET Core web applications (To...PROIDEA
This talk won't be about SignalR (it will be mentioned but that's all). It will focus on native techniques like WebSockets, Server-Sent Events and Push API. It will show how to use them and suggest when to use them by exploring their strong and weak sides.
The document discusses the HTTP request methods GET and POST. GET requests retrieve data from a specified resource, while POST submits data to be processed by a specified resource. Both can send requests and receive responses. GET requests can be cached, bookmarked, and have data restrictions. POST requests are never cached, cannot be bookmarked, and have no data restrictions. The document compares the advantages and disadvantages of GET and POST and provides examples of appropriate uses for each.
HTML5 Server Sent Events/JSF JAX 2011 ConferenceRoger Kitain
This document discusses server-sent events (SSE) for pushing data from servers to clients. It begins with an introduction to server-side push and strategies like client polling. It then explains SSE which allows a web page to subscribe to a stream of events from the server using a JavaScript API. The document demonstrates how to implement SSE on both the client-side and server-side. It also discusses how SSE can be used with JavaServer Faces (JSF) composite components to build rich, dynamic components that leverage two-way communication between client and server.
La presentazione tenuta da Simone Bordet in occasione del Codemotion Roma del 5 marzo 2011 - http://www.codemotion.it/
Si parlerà delle web applications di tipo Comet, cioè di quelle web applications che si occupano di notificare con latenza bassissima - di norma a browsers - eventi ricevuti dal server come stock price, eventi sportivi, giochi online, etc. La sessione proseguirà con una discussione sugli impatti che le applicazioni Comet hanno nello sviluppo e nel deployment, e con una panoramica sul nuovo protocollo WebSocket definito da HTML5 e sul progetto open source CometD.
This document discusses various Enterprise Application Integration centric designs or approaches which may be considered as better practices, and have been implemented in the data acquisition platform at Nielsen. Targeted audience is tech leaders and architects working across the platform. There is a special focus on leveraging open source technologies where possible. Hoping that some of the material here can help fellow architects.
Webinar slides "Building Real-Time Collaborative Web Applications"Sachin Katariya
Key Takeaways:
1> Key technology enablers for real-time collaboration
2> Supporting open source technologies such as Node.js, WebSocket and HTML5
3> Enriching user experience with real-time collaboration
4> Demonstration of a sample real-time collaborative web application
5> Performance benchmarks
HTTP requests and responses follow a generic message format that includes a start line, message headers, an optional message body, and optional trailers. The start line indicates the request method and URI for requests or the HTTP version and status code for responses. Headers provide additional metadata about the message, sender, recipient, or content. The body carries request data or response content. Trailers are rarely used and provide additional headers after chunked content.
4Developers 2018: Real-time capabilities in ASP.NET Core web applications (To...PROIDEA
This talk won't be about SignalR (it will be mentioned but that's all). It will focus on native techniques like WebSockets, Server-Sent Events and Push API. It will show how to use them and suggest when to use them by exploring their strong and weak sides.
The document discusses the HTTP request methods GET and POST. GET requests retrieve data from a specified resource, while POST submits data to be processed by a specified resource. Both can send requests and receive responses. GET requests can be cached, bookmarked, and have data restrictions. POST requests are never cached, cannot be bookmarked, and have no data restrictions. The document compares the advantages and disadvantages of GET and POST and provides examples of appropriate uses for each.
HTML5 Server Sent Events/JSF JAX 2011 ConferenceRoger Kitain
This document discusses server-sent events (SSE) for pushing data from servers to clients. It begins with an introduction to server-side push and strategies like client polling. It then explains SSE which allows a web page to subscribe to a stream of events from the server using a JavaScript API. The document demonstrates how to implement SSE on both the client-side and server-side. It also discusses how SSE can be used with JavaServer Faces (JSF) composite components to build rich, dynamic components that leverage two-way communication between client and server.
HTTP is a protocol for transmitting hypermedia documents across the internet. It uses a client-server model where browsers make HTTP requests to web servers, which respond with HTTP responses. Key aspects of HTTP include using TCP/IP for communication, being stateless, supporting a variety of data types, and incorporating features of both FTP and SMTP protocols.
This document provides an overview of HTTP including:
- HTTP is a stateless protocol that does not require servers to retain user information across requests.
- Popular HTTP proxy tools like Fiddler and Burp Suite can be used to inspect and debug HTTP traffic.
- Key parts of HTTP include requests methods, response codes, headers for accepting content types, encoding, authentication, and more.
- Common players that interact with HTTP include web servers, load balancers, caching servers, CDNs, and security tools.
This document discusses using WebSocket technology for real-time financial stock applications. It begins by explaining how traditional HTTP polling and long polling methods are not ideal for real-time applications due to latency and overhead issues. It then introduces WebSocket as a better solution, allowing for low-latency, bidirectional communication between clients and servers. The document proposes developing a stock application using WebSocket to demonstrate its effectiveness for real-time web applications. It describes how the application would allow clients to receive immediate stock price updates from the server as they occur.
This document summarizes a lecture on computer networks and the hypertext transfer protocol (HTTP). It first reviews the early history of computer networking and the development of the world wide web. It then provides details on HTTP, including requests and responses, methods, status codes, and cookies. It discusses how caching works to improve performance by satisfying requests locally when possible. Methods like If-Modified-Since are described which check if a cached object has been updated before retrieving from the origin server.
This document summarizes key principles for building scalable, reliable and secure RESTful services using HTTP. It discusses how to ensure reliability through idempotent operations. It also covers techniques for scaling such as use of ETags, caching, content types and uniform resource locators (URLs). The document concludes with an overview of security considerations and tools that can be used including HTTP authentication, SSL and XML signature/encryption.
This document provides an overview of real-time web technologies including Comet, long polling, HTTP streaming, forever frames, Server-Sent Events, and WebSockets. Comet is an umbrella term for techniques used to push data from a server to a browser in real-time. Long polling, HTTP streaming, and forever frames are different Comet programming models. Server-Sent Events and WebSockets are HTML5 solutions for real-time connections, with Server-Sent Events using HTTP streaming and WebSockets using a bidirectional TCP connection. Both approaches have advantages and disadvantages in terms of features, reliability, and proxy/firewall support.
The document discusses HTTP request and response messages. Some key points:
- HTTP is a stateless, client-server protocol where clients send requests to servers and servers return response messages. Requests use methods like GET and POST and URLs to identify resources.
- Request messages contain a start line with the method, URL, and HTTP version, followed by header lines. Response messages contain a start line with the status code and reason, followed by header lines and an optional body.
- Common status codes include 200 for success, 404 for not found, 401 for unauthorized, and 500 for server errors.
- HTML forms can send data via GET by adding parameters to the URL or POST by placing them in the
HTTP is the set of rules for transferring data across the World Wide Web. It uses clients like web browsers to make requests to servers using URLs over TCP/IP. HTTP defines request and response messages with request methods like GET and POST and response status codes. HTTP 1.1 supports persistent connections and caching via proxy servers for improved performance over HTTP 1.0.
HTTP is an application-layer protocol for transmitting hypermedia documents across the internet. It is a stateless protocol that can be used on any reliable transport layer. HTTP uses requests and responses between clients and servers, with common methods including GET, POST, PUT, DELETE. It supports features like caching, cookies, authentication, and more to enable the web as we know it.
HTTP is a stateless protocol that uses a request/response model for communication. A client sends a request via a URL to a server, which responds with status codes and content. Common request methods include GET, POST, PUT, DELETE. Responses have status codes like 200 for success and 404 for not found. Caching of responses helps improve performance. HTTPS provides encryption for secure communication via SSL/TLS certificates.
HTTP is a protocol for transmitting hypermedia documents across the internet. It uses a client-server model where a web browser makes HTTP requests to a web server. The server then responds with the requested resources.
HTTP uses TCP/IP and the default port is 80. Requests have a method line specifying the request method (GET, POST, etc.), URL, and HTTP version. Responses have a status line with the HTTP version, status code, and reason phrase. Both include optional header lines and message body. Common methods are GET to retrieve a resource and POST to submit data to a server. Status codes indicate if a request was successful or encountered an error.
HTTP is the protocol of the web, and in this session we will look at HTTP from a web developer's perspective. We will cover resources, messages, cookies, and authentication protocols and we will see how the web scales to meet demand using cache headers. Armed with the fundamentals about HTTP, you will have the knowledge not only to build better Web/Mobile applications but also for consuming Web API.
HTTP is an application-level protocol for distributed, collaborative hypermedia systems that has been used by the World Wide Web since 1990. The initial HTTP/0.9 version provided a simple protocol for raw data transfer, while HTTP/1.0 introduced MIME-like messages to include meta information and request/response modifiers. HTTP/1.0 did not sufficiently account for hierarchical proxies, caching, persistent connections or virtual hosts. HTTP sits at the top of the TCP/IP stack and uses ports to carry protocols between services, with HTTP typically using port 80. An HTTP message is delivered over a TCP/IP connection by chopping the message into chunks small enough to fit in TCP segments, which are then sent inside IP datagrams
The document discusses various techniques for improving web performance, including optimizing load times, reducing latency, prioritizing critical resources, and preloading assets. It notes that delays of 500ms can increase user frustration by 26% and reduce traffic to sites like Google by 20%. It then outlines specific methods like optimizing the initial TCP window size, leveraging service workers, using HTTP/2 and content delivery networks, prioritizing critical CSS and JavaScript, optimizing image formats, ensuring consistent frame rates, and preloading fonts.
This document discusses server-side programming using Java servlets. It begins by explaining the difference between static and dynamic web pages/server responses. Java servlets provide a way to generate dynamic responses by instantiating a servlet class in response to an HTTP request. The document then covers the basics of servlets, including the servlet lifecycle methods and using request and response objects to add content and generate the HTTP response. It also discusses retrieving and handling parameter data passed in the HTTP request, as well as using HTTP sessions to maintain state across multiple requests and pages.
Overview of what's going on in the HTTP world. This is the latest version of a talk I've given in the past at Google, Bell Labs and QCon San Francisco.
The document discusses various techniques for building mashups including AJAX. It defines mashups as lightweight web applications that combine content from existing sources via public APIs. It describes how AJAX uses XMLHttpRequest to asynchronously retrieve data from servers in the background without page refreshes. This improves responsiveness. JSON is also discussed as a data format used for mashups. Challenges with mashups include lack of APIs and difficulties accessing unstructured internal data.
The document discusses the web request and response lifecycle from DNS lookup through HTTP methods and status codes. It describes the process of DNS lookup involving the browser, operating system, resolving name server, root name server, top-level domain name server and authoritative name server to resolve a domain name like www.yahoo.com to an IP address. It then explains the stateless HTTP protocol and how it can deliver different types of data, as well as the TCP three-way handshake process for establishing a connection and transmitting data using windows and acknowledgements. The document also briefly mentions HTTP requests, responses, methods including safe and idempotent methods, and status codes.
UOW-Caching and new ways to improve response time (Paper)Guson Kuntarto
This document discusses how web cache proxy servers can improve response time for end users. It explains that a web cache proxy server stores recently accessed web objects to reduce the number of requests sent to origin servers. When a cached object is requested, the proxy server can return it directly, improving response time compared to fetching it from the origin server. The document cites a study that found using a caching proxy reduced average response times by 0.9 seconds without persistent connections and 1.7 seconds with persistent connections.
A SURVEY ON WEB PRE-FETCHING AND WEB CACHING TECHNIQUES IN A MOBILE ENVIRONMENTcscpconf
As the Internet continues to grow in size and popularity, web traffic and network bottlenecks are
major issues in the network world. The continued increase in demand for objects on the Internet
causes severe overloading in many sites and network links. Many users have no patience in
waiting more than few seconds for downloading a web page. Web traffic reduction techniques
are necessary for accessing the web sites efficiently with the facility of existing network. Web
pre-fetching techniques and web caching reduces the web latency that we face on the internet
today. This paper describes about the various prefetching and caching techniques, how they
predict the web object to be pre-fetched and what are the issues challenges involved when these techniques are applied to a mobile environment.
With the growing challenges we face with shortage of resources there is a constant need to improve scalability and performance. Fortunately Java EE 7 and Java SE 7 has provided a rich set of APIs which can be used to avoid the conventional request-response paradigm. The session will span across JSRs cover how JAX-RS, Servlets, WebSockets, EJB provide support to submit asynchronous requests and cover topics like callbacks, timeouts, client side asynchrony, API like non blocking IO and lots of good stuff from Java EE 7 and Java SE 7 . Prerequisite: An open mind and be ready to “Think async”
This document provides an overview of building dynamic web applications. It discusses clients and servers, with web browsers serving as clients that make requests to web servers. It also covers how to write a server using ports, how the request-response cycle works for websites, and why web frameworks are useful for building web applications. Key aspects of web frameworks covered include routing URLs, templating, databases, sessions and cookies, and security considerations.
HTTP is a protocol for transmitting hypermedia documents across the internet. It uses a client-server model where browsers make HTTP requests to web servers, which respond with HTTP responses. Key aspects of HTTP include using TCP/IP for communication, being stateless, supporting a variety of data types, and incorporating features of both FTP and SMTP protocols.
This document provides an overview of HTTP including:
- HTTP is a stateless protocol that does not require servers to retain user information across requests.
- Popular HTTP proxy tools like Fiddler and Burp Suite can be used to inspect and debug HTTP traffic.
- Key parts of HTTP include requests methods, response codes, headers for accepting content types, encoding, authentication, and more.
- Common players that interact with HTTP include web servers, load balancers, caching servers, CDNs, and security tools.
This document discusses using WebSocket technology for real-time financial stock applications. It begins by explaining how traditional HTTP polling and long polling methods are not ideal for real-time applications due to latency and overhead issues. It then introduces WebSocket as a better solution, allowing for low-latency, bidirectional communication between clients and servers. The document proposes developing a stock application using WebSocket to demonstrate its effectiveness for real-time web applications. It describes how the application would allow clients to receive immediate stock price updates from the server as they occur.
This document summarizes a lecture on computer networks and the hypertext transfer protocol (HTTP). It first reviews the early history of computer networking and the development of the world wide web. It then provides details on HTTP, including requests and responses, methods, status codes, and cookies. It discusses how caching works to improve performance by satisfying requests locally when possible. Methods like If-Modified-Since are described which check if a cached object has been updated before retrieving from the origin server.
This document summarizes key principles for building scalable, reliable and secure RESTful services using HTTP. It discusses how to ensure reliability through idempotent operations. It also covers techniques for scaling such as use of ETags, caching, content types and uniform resource locators (URLs). The document concludes with an overview of security considerations and tools that can be used including HTTP authentication, SSL and XML signature/encryption.
This document provides an overview of real-time web technologies including Comet, long polling, HTTP streaming, forever frames, Server-Sent Events, and WebSockets. Comet is an umbrella term for techniques used to push data from a server to a browser in real-time. Long polling, HTTP streaming, and forever frames are different Comet programming models. Server-Sent Events and WebSockets are HTML5 solutions for real-time connections, with Server-Sent Events using HTTP streaming and WebSockets using a bidirectional TCP connection. Both approaches have advantages and disadvantages in terms of features, reliability, and proxy/firewall support.
The document discusses HTTP request and response messages. Some key points:
- HTTP is a stateless, client-server protocol where clients send requests to servers and servers return response messages. Requests use methods like GET and POST and URLs to identify resources.
- Request messages contain a start line with the method, URL, and HTTP version, followed by header lines. Response messages contain a start line with the status code and reason, followed by header lines and an optional body.
- Common status codes include 200 for success, 404 for not found, 401 for unauthorized, and 500 for server errors.
- HTML forms can send data via GET by adding parameters to the URL or POST by placing them in the
HTTP is the set of rules for transferring data across the World Wide Web. It uses clients like web browsers to make requests to servers using URLs over TCP/IP. HTTP defines request and response messages with request methods like GET and POST and response status codes. HTTP 1.1 supports persistent connections and caching via proxy servers for improved performance over HTTP 1.0.
HTTP is an application-layer protocol for transmitting hypermedia documents across the internet. It is a stateless protocol that can be used on any reliable transport layer. HTTP uses requests and responses between clients and servers, with common methods including GET, POST, PUT, DELETE. It supports features like caching, cookies, authentication, and more to enable the web as we know it.
HTTP is a stateless protocol that uses a request/response model for communication. A client sends a request via a URL to a server, which responds with status codes and content. Common request methods include GET, POST, PUT, DELETE. Responses have status codes like 200 for success and 404 for not found. Caching of responses helps improve performance. HTTPS provides encryption for secure communication via SSL/TLS certificates.
HTTP is a protocol for transmitting hypermedia documents across the internet. It uses a client-server model where a web browser makes HTTP requests to a web server. The server then responds with the requested resources.
HTTP uses TCP/IP and the default port is 80. Requests have a method line specifying the request method (GET, POST, etc.), URL, and HTTP version. Responses have a status line with the HTTP version, status code, and reason phrase. Both include optional header lines and message body. Common methods are GET to retrieve a resource and POST to submit data to a server. Status codes indicate if a request was successful or encountered an error.
HTTP is the protocol of the web, and in this session we will look at HTTP from a web developer's perspective. We will cover resources, messages, cookies, and authentication protocols and we will see how the web scales to meet demand using cache headers. Armed with the fundamentals about HTTP, you will have the knowledge not only to build better Web/Mobile applications but also for consuming Web API.
HTTP is an application-level protocol for distributed, collaborative hypermedia systems that has been used by the World Wide Web since 1990. The initial HTTP/0.9 version provided a simple protocol for raw data transfer, while HTTP/1.0 introduced MIME-like messages to include meta information and request/response modifiers. HTTP/1.0 did not sufficiently account for hierarchical proxies, caching, persistent connections or virtual hosts. HTTP sits at the top of the TCP/IP stack and uses ports to carry protocols between services, with HTTP typically using port 80. An HTTP message is delivered over a TCP/IP connection by chopping the message into chunks small enough to fit in TCP segments, which are then sent inside IP datagrams
The document discusses various techniques for improving web performance, including optimizing load times, reducing latency, prioritizing critical resources, and preloading assets. It notes that delays of 500ms can increase user frustration by 26% and reduce traffic to sites like Google by 20%. It then outlines specific methods like optimizing the initial TCP window size, leveraging service workers, using HTTP/2 and content delivery networks, prioritizing critical CSS and JavaScript, optimizing image formats, ensuring consistent frame rates, and preloading fonts.
This document discusses server-side programming using Java servlets. It begins by explaining the difference between static and dynamic web pages/server responses. Java servlets provide a way to generate dynamic responses by instantiating a servlet class in response to an HTTP request. The document then covers the basics of servlets, including the servlet lifecycle methods and using request and response objects to add content and generate the HTTP response. It also discusses retrieving and handling parameter data passed in the HTTP request, as well as using HTTP sessions to maintain state across multiple requests and pages.
Overview of what's going on in the HTTP world. This is the latest version of a talk I've given in the past at Google, Bell Labs and QCon San Francisco.
The document discusses various techniques for building mashups including AJAX. It defines mashups as lightweight web applications that combine content from existing sources via public APIs. It describes how AJAX uses XMLHttpRequest to asynchronously retrieve data from servers in the background without page refreshes. This improves responsiveness. JSON is also discussed as a data format used for mashups. Challenges with mashups include lack of APIs and difficulties accessing unstructured internal data.
The document discusses the web request and response lifecycle from DNS lookup through HTTP methods and status codes. It describes the process of DNS lookup involving the browser, operating system, resolving name server, root name server, top-level domain name server and authoritative name server to resolve a domain name like www.yahoo.com to an IP address. It then explains the stateless HTTP protocol and how it can deliver different types of data, as well as the TCP three-way handshake process for establishing a connection and transmitting data using windows and acknowledgements. The document also briefly mentions HTTP requests, responses, methods including safe and idempotent methods, and status codes.
UOW-Caching and new ways to improve response time (Paper)Guson Kuntarto
This document discusses how web cache proxy servers can improve response time for end users. It explains that a web cache proxy server stores recently accessed web objects to reduce the number of requests sent to origin servers. When a cached object is requested, the proxy server can return it directly, improving response time compared to fetching it from the origin server. The document cites a study that found using a caching proxy reduced average response times by 0.9 seconds without persistent connections and 1.7 seconds with persistent connections.
A SURVEY ON WEB PRE-FETCHING AND WEB CACHING TECHNIQUES IN A MOBILE ENVIRONMENTcscpconf
As the Internet continues to grow in size and popularity, web traffic and network bottlenecks are
major issues in the network world. The continued increase in demand for objects on the Internet
causes severe overloading in many sites and network links. Many users have no patience in
waiting more than few seconds for downloading a web page. Web traffic reduction techniques
are necessary for accessing the web sites efficiently with the facility of existing network. Web
pre-fetching techniques and web caching reduces the web latency that we face on the internet
today. This paper describes about the various prefetching and caching techniques, how they
predict the web object to be pre-fetched and what are the issues challenges involved when these techniques are applied to a mobile environment.
With the growing challenges we face with shortage of resources there is a constant need to improve scalability and performance. Fortunately Java EE 7 and Java SE 7 has provided a rich set of APIs which can be used to avoid the conventional request-response paradigm. The session will span across JSRs cover how JAX-RS, Servlets, WebSockets, EJB provide support to submit asynchronous requests and cover topics like callbacks, timeouts, client side asynchrony, API like non blocking IO and lots of good stuff from Java EE 7 and Java SE 7 . Prerequisite: An open mind and be ready to “Think async”
This document provides an overview of building dynamic web applications. It discusses clients and servers, with web browsers serving as clients that make requests to web servers. It also covers how to write a server using ports, how the request-response cycle works for websites, and why web frameworks are useful for building web applications. Key aspects of web frameworks covered include routing URLs, templating, databases, sessions and cookies, and security considerations.
This document provides an overview of client-server web sockets from Plasma University's College of Engineering Technology. It defines what web sockets are, explains why they are needed and when to avoid them, compares HTTP and web socket connections, and outlines the web socket protocol including how web sockets work, handshake processes, and differences from HTTP.
This document discusses web servers. It begins by defining a web server as hardware or software that helps deliver internet content. It then discusses the history of web servers, including the first web server created by Tim Berners-Lee at CERN in 1990. The document outlines common uses of web servers like hosting websites, data storage, and content delivery. It also describes how web servers work, including how they handle requests and responses using HTTP. Finally, it covers topics like installing and hosting a web server, load limits, overload causes and symptoms, and techniques to prevent overload.
Server Sent Events, Async Servlet, Web Sockets and JSON; born to work together!Masoud Kalali
This session focuses on how Java EE 7 provides extensive set of new and enhanced features to support standards like HTML5, WebSockets, and Server Sent Events among others.In this session we will show how these new features are designed and matched to work together for developing lightweight solutions matching end users high expectation from a web application’s responsiveness. The session will cover best practices and design patterns governing application development using JAX-RS 2.0, Async Servlet, and JSON-P (among others) as well as iterating over the pitfalls that should be avoided. During the session we will show code snippets and block diagrams that clarify use of APIs coming from the demo application we will show at the end.
Webinar - Building Real-Time Collaborative Web Applications
The digital revolution has brought in a change in the way we communicate and collaborate. Research shows that number of mobile workers will reach up to 1.3 billion by 2015. The pace of information flow has been astounding. These factors have fuelled the pressing demand among customers, businesses, for real time web applications.
Real-time web applications have been around for many years. But today, the users expect collaborative, personalized and an amazingly interactive experience using real time web technologies.
Key Takeaways:
Key technology enablers for real-time collaboration
Supporting open source technologies such as Node.js, WebSocket and HTML5
Enriching user experience with real-time collaboration
Demonstration of a sample real-time collaborative web application
Performance benchmarks
A web server is software that responds to requests from web browsers to serve web pages. It is part of a multi-tier architecture with an information tier (database), middle tier (application logic), and client tier (user interface). The most common protocol for communication between clients and servers is HTTP, with the server responding to GET and POST requests with web pages or other responses. Popular web server software includes Apache, IIS, and Tomcat.
21. Application Development and Administration in DBMSkoolkampus
The document provides an overview of web interfaces to databases and techniques for improving web application performance. It discusses how databases can be interfaced with the web to allow users to access data from anywhere. It then covers topics like dynamic page generation, sessions, cookies, servlets, server-side scripting, and techniques for improving web server performance like caching. The document also discusses performance tuning at the hardware, database, and transaction levels to identify and address bottlenecks.
This document discusses Java networking and client/server communication. A client machine makes requests to a server machine over a network using protocols like TCP and UDP. TCP provides reliable data transmission while UDP sends independent data packets. Port numbers map incoming data to running processes. Sockets provide an interface for programming networks, with ServerSocket and Socket classes in Java. A server program listens on a port for client connections and exchanges data through input/output streams. Servlets extend web server functionality by executing Java programs in response to client requests.
MCIS 6163 Assignment 1/MCIS 6163 Assignment 1.pdf
Assignment 1 – MCIS 6163
Building a Simple Web Client and a Multithreaded Web Server
Objectives
To understand client-server communication via sockets.
To gain exposure to the basic operations of a Web server and client.
To explore basic structures of HTTP messages.
Due: April 14, 2020 11:59pm
Project Description
In this project, you will be developing a multithreaded Web server and a simple web client. The Web
server and Web client communicate using a text-based protocol called HTTP (Hypertext Transfer
Protocol).
Requirements for the Web server
The server is able to handle multiple requests concurrently. This means the implementation is
multithreaded. In the main thread, the server listens to a specified port, e.g., 8080. Upon receiving an
HTTP request, the server sets up a TCP connection to the requesting client and serves the request in a
separate thread. After sending the response back to the client, it closes the connection.
The server is assumed to work with HTTP GET messages. If the requested file exists, the server
responds with “HTTP/1.1 200 OK” together with the requested page to the client, otherwise it sends a
corresponding error message, e.g., “HTTP/1.1 404 Not Found” or “HTTP/1.1 400 Bad Request”.
If running the server program using command line, the syntax should be:
server_code_name [<port_number>]
where the optional <port_number> is the port on which the server is listening to connections from
clients. If the port number is not entered, the default port 8080 is used.
You can test your Web server implementation on your local machine using a Web browser, e.g.,
Internet Explorer, Firefox, or Chrome. You need to specify the used port number within the URL, for
example,
http://localhost:8080/index.htm
If omitting the port number portion, i.e., 8080, the browser will use the default port 80.
The server should response with a default page when users do not enter a specific page in the URL,
for example,
http://localhost:8080/
It should also work when the request includes a path to the requested file, for example,
http://localhost:8080/path/to/file/example.htm
You should display/log the request and header lines of request messages on the server for the purpose
of debugging.
Requirements for the simple Web client
The client is able to connect to the server via a socket and to request a page on the server.
Upon receipt of the response message from the server, the client extracts and displays/logs the
message status, and then retrieves the page content from the message body.
If running the client program using command line, the syntax should be:
client_code_name <server_IPaddress/name> [<port_number>] [<requested_file_name>]
where the <server_IPaddress/name> is the IP address or name of the Web server, e.g., 127.0.0.1 or
localhost for the server running on the local machine. The optional < ...
MCIS 6163 Assignment 1/MCIS 6163 Assignment 1.pdf
Assignment 1 – MCIS 6163
Building a Simple Web Client and a Multithreaded Web Server
Objectives
To understand client-server communication via sockets.
To gain exposure to the basic operations of a Web server and client.
To explore basic structures of HTTP messages.
Due: April 14, 2020 11:59pm
Project Description
In this project, you will be developing a multithreaded Web server and a simple web client. The Web
server and Web client communicate using a text-based protocol called HTTP (Hypertext Transfer
Protocol).
Requirements for the Web server
The server is able to handle multiple requests concurrently. This means the implementation is
multithreaded. In the main thread, the server listens to a specified port, e.g., 8080. Upon receiving an
HTTP request, the server sets up a TCP connection to the requesting client and serves the request in a
separate thread. After sending the response back to the client, it closes the connection.
The server is assumed to work with HTTP GET messages. If the requested file exists, the server
responds with “HTTP/1.1 200 OK” together with the requested page to the client, otherwise it sends a
corresponding error message, e.g., “HTTP/1.1 404 Not Found” or “HTTP/1.1 400 Bad Request”.
If running the server program using command line, the syntax should be:
server_code_name [<port_number>]
where the optional <port_number> is the port on which the server is listening to connections from
clients. If the port number is not entered, the default port 8080 is used.
You can test your Web server implementation on your local machine using a Web browser, e.g.,
Internet Explorer, Firefox, or Chrome. You need to specify the used port number within the URL, for
example,
http://localhost:8080/index.htm
If omitting the port number portion, i.e., 8080, the browser will use the default port 80.
The server should response with a default page when users do not enter a specific page in the URL,
for example,
http://localhost:8080/
It should also work when the request includes a path to the requested file, for example,
http://localhost:8080/path/to/file/example.htm
You should display/log the request and header lines of request messages on the server for the purpose
of debugging.
Requirements for the simple Web client
The client is able to connect to the server via a socket and to request a page on the server.
Upon receipt of the response message from the server, the client extracts and displays/logs the
message status, and then retrieves the page content from the message body.
If running the client program using command line, the syntax should be:
client_code_name <server_IPaddress/name> [<port_number>] [<requested_file_name>]
where the <server_IPaddress/name> is the IP address or name of the Web server, e.g., 127.0.0.1 or
localhost for the server running on the local machine. The optional <.
WebSocket is a protocol that provides full-duplex communication channels over a single TCP connection. It was standardized in 2011 and allows for real-time data exchange between a client and server. The document discusses how WebSocket works, compares it to previous techniques like polling which had limitations, and outlines how to implement WebSocket in Java using JSR 356 and in Spring using the WebSocket API and STOMP protocol.
An In-Depth Comparison of WebSocket and SignalR: Pros, Cons, and Use CasesTien Nguyen
WebSocket or SignalR: which technology is better for your real-time web application? This comprehensive comparison covers everything from API and performance to scalability and security.
The document describes a chat server application built using Java sockets. It includes a client and server component that allow users to login and send messages to each other. The server uses multithreading to handle multiple client connections concurrently by passing accepted socket connections to separate thread objects. The chat server provides group and private messaging capabilities and could be expanded in the future to include additional features like offline messaging, file sharing, and a user profile database.
This document discusses building real-time web applications and introduces SignalR as a library that simplifies creating persistent HTTP connections for real-time functionality. It describes how older techniques like polling and long polling have disadvantages, while newer techniques like web sockets have limited browser support. SignalR abstracts these complexities by automatically negotiating the best transport and allowing real-time functionality to be easily added to applications. It also enables scaling out applications across servers and backing services. Demos and components of SignalR are presented, along with how it provides a fallback mechanism to support older servers and clients.
The document discusses web servers and their architecture. It begins by defining a web server as specialized software that responds to client requests from web browsers. It then describes the common three-tier architecture of web applications with tiers for the client interface, middle application logic, and database information. The document focuses on how web servers use HTTP to communicate with clients through a request-response protocol and provides examples of GET and POST requests. It also discusses leading web servers like Apache, IIS, and others as well as factors to consider when selecting a web server.
Web Component Development Using Servlet & JSP Technologies (EE6) - Chapter 4...WebStackAcademy
Setting up a servlet environment
Servlets are Java programs that run on a Web server and build Web pages. Here are a few definitions:
Servlet Development Kits
Java Servlet Development Kit (JSDK) provides Servlet API classes (servlet.jar). Place servlet.jar into CLASSPATH, so that java classes can access it.
Servlet Engines
A servlet is a Java class that needs to be executed in a Java VM by servlet engine. The servlet engine loads the servlet class the first time the servlet is requested. The servlet then stays loaded to handle multiple requests until it is explicitly unloaded or the servlet engine is shut down.
Following are few WebServers that supports servlets:
Apache Tomcat
BEA WebLogic
IBM Websphere
Sun's Java Web Server (JWS)
Apache Tomcat.
Java Servlet Development Kit (JSDK)
The document discusses server-side programming and Java 2 Enterprise Edition (J2EE). It explains what J2EE is, its architecture and components. It describes the lifecycle of a servlet, including initialization, request handling, and destruction. It also discusses session management techniques in servlets like using cookies, URL rewriting, and hidden form fields to track user requests across multiple pages. Exception handling using request dispatchers is also covered.
Six months ago, Confluence Cloud’s reliability for enterprise tenants was at an all time low. This is the story of how we turned things around - starting with the fundamentals of measuring everything, re-defining metrics to be insightful of actual customer pain, auditing end-to-end resilience. The most challenging part however, has been building the reliability habit. Beyond just devops best practices, this means empowering teams to own product stability front and center through practices and tools.
Scaling Confluence Architecture: A Sneak Peek Under the HoodBhakti Mehta
Atlassian’s Confluence is content collaboration software that changes how modern teams work. It is trusted by more than 35,000 teams and millions of users. This session presents a deep dive to provide insights into how the Confluence architecture has evolved into its current form. It discusses how Atlassian deploys, runs, and operates at scale and challenges encountered along the way. Using examples of real-life incidents, the session covers best practices and lessons learned for building resilient, stable, and predictable services. Learn how Atlassian isolated the impact of failures and blast radius by microservice sharding and proper tuning, and hear about strategies for dependency scaling, failure injection, deployment pipelines, and end-to-end testing.
Bhakti Mehta presented on architecting microservices for failures and lessons learned. Some key points include:
1) When developing microservices, techniques like circuit breakers, timeouts, retries, and rate limiting can help avoid cascading failures.
2) extensive testing including load testing and failure injection testing should be done before production deployment.
3) After deploying to production, continuous monitoring of metrics and health checks is important to quickly identify issues.
Architecting for Failures in micro services: patterns and lessons learnedBhakti Mehta
This document provides an overview of architecting microservices for failures based on the presenter's experience. It discusses the path from monoliths to microservices, challenges that emerge at scale including failures, and lessons learned for making systems resilient. The presentation covers failure prevention patterns like circuit breakers, timeouts, retries, and bulkheads. It also discusses monitoring techniques like health checks, metrics, and phased rollouts for new features. The goal is to anticipate failures and design systems that can withstand transient errors and continue functioning.
Let if flow: Java 8 Streams puzzles and moreBhakti Mehta
This talk covers Java 8 Streams in details and using programming puzzles will discuss about various techniques with Streams: how to do complex data processing , queries with Streams API, how to use all the goodies like map, flatMap,filter, how to group, and partition data, how to use infinite streams, parallel streams, creating lazy lists.
If you are a beginner or a pro with Java 8 wanting to challenge your knowledge there is something for all!
Expect the unexpected: Prepare for failures in microservicesBhakti Mehta
My talk at Confoo 2016 Montreal
It is well said that "The more you sweat on the field, the less you bleed in war". Failures are an inevitable part of complex systems. Accepting that failures happen, will help you design the system's reactions to specific failures.
This talks on best practices for building resilient, stable and predictable services:
preventing Cascading failures, Timeouts pattern, Retry pattern,Circuit breakers
and many more techniques in microservices
Resilience planning and how the empire strikes backBhakti Mehta
t is well said that "The more you sweat on the field, the less you bleed in war". Failures are an inevitable part of complex systems. Accepting that failures happen, will help you design the system's reactions to specific failures.
This talks on best practices for building resilient, stable and predictable services: preventing cascading failures, timeouts pattern, retry pattern,circuit breakers and other techniques which have been pervasively used at Blue Jeans Network. Join me in this talk which ensures that the show must go on in spite of random load, stress or other failures!
Expect the unexpected: Anticipate and prepare for failures in microservices b...Bhakti Mehta
Bhakti Mehta discusses strategies for building resilient microservices architectures. Mehta covers challenges like cascading failures and latency that can occur at scale. Techniques like circuit breakers, timeouts, retries, and bulkheading are presented to isolate failures and prevent them from spreading. Logging and metrics are also important for monitoring systems and identifying issues after deployment. The talk emphasizes anticipating failures through approaches like load testing and designing systems to automatically recover from failures.
Real world RESTful service development problems and solutionsBhakti Mehta
Learn all you ever wanted to learn about RESTful services development challenges in large scale applications
This session is a deep dive as well as an interactive discussion on design principles, considerations, lessons learned from mistakes that can be taken into account when developing RESTful services. It will cover a variety of topics from Designing of RESTful resources, Versioning, Exception Handling, Caching, Validation, Security, Rate limiting, HATEOAS, Testing and Documentation. This talk will walk through and compare the different REST API provided by companies like Twitter, Paypal, Google, Stripe and more we can learn the good, the bad and ugly. So join me in this talk to build high quality applications that can be highly scalable, available and reliable.
This document provides tips for using the GlassFish application server. It begins with an introduction to GlassFish and outlines the goals of the session. The body contains over 30 tips covering a wide range of GlassFish topics from using the asadmin command to configuring clusters. Each tip is presented concisely in 1-2 paragraphs and includes code examples.
Con fess 2013-sse-websockets-json-bhaktiBhakti Mehta
This document provides an overview of several technologies for asynchronous communication between client and server: Server Sent Events (SSE), WebSockets, JSON-P, JAXRS 2.0, and AsyncServlet. It describes how SSE allows a server to push data to clients via an event stream, discusses the WebSocket protocol for full-duplex communication, and explains how JSON-P and JAXRS 2.0 support processing JSON on the Java platform. Code samples are provided for using these technologies. The document concludes by describing a demo application that integrates several of these techniques to asynchronously retrieve and display Twitter data.
HCL Notes und Domino Lizenzkostenreduzierung in der Welt von DLAUpanagenda
Webinar Recording: https://www.panagenda.com/webinars/hcl-notes-und-domino-lizenzkostenreduzierung-in-der-welt-von-dlau/
DLAU und die Lizenzen nach dem CCB- und CCX-Modell sind für viele in der HCL-Community seit letztem Jahr ein heißes Thema. Als Notes- oder Domino-Kunde haben Sie vielleicht mit unerwartet hohen Benutzerzahlen und Lizenzgebühren zu kämpfen. Sie fragen sich vielleicht, wie diese neue Art der Lizenzierung funktioniert und welchen Nutzen sie Ihnen bringt. Vor allem wollen Sie sicherlich Ihr Budget einhalten und Kosten sparen, wo immer möglich. Das verstehen wir und wir möchten Ihnen dabei helfen!
Wir erklären Ihnen, wie Sie häufige Konfigurationsprobleme lösen können, die dazu führen können, dass mehr Benutzer gezählt werden als nötig, und wie Sie überflüssige oder ungenutzte Konten identifizieren und entfernen können, um Geld zu sparen. Es gibt auch einige Ansätze, die zu unnötigen Ausgaben führen können, z. B. wenn ein Personendokument anstelle eines Mail-Ins für geteilte Mailboxen verwendet wird. Wir zeigen Ihnen solche Fälle und deren Lösungen. Und natürlich erklären wir Ihnen das neue Lizenzmodell.
Nehmen Sie an diesem Webinar teil, bei dem HCL-Ambassador Marc Thomas und Gastredner Franz Walder Ihnen diese neue Welt näherbringen. Es vermittelt Ihnen die Tools und das Know-how, um den Überblick zu bewahren. Sie werden in der Lage sein, Ihre Kosten durch eine optimierte Domino-Konfiguration zu reduzieren und auch in Zukunft gering zu halten.
Diese Themen werden behandelt
- Reduzierung der Lizenzkosten durch Auffinden und Beheben von Fehlkonfigurationen und überflüssigen Konten
- Wie funktionieren CCB- und CCX-Lizenzen wirklich?
- Verstehen des DLAU-Tools und wie man es am besten nutzt
- Tipps für häufige Problembereiche, wie z. B. Team-Postfächer, Funktions-/Testbenutzer usw.
- Praxisbeispiele und Best Practices zum sofortigen Umsetzen
Essentials of Automations: The Art of Triggers and Actions in FMESafe Software
In this second installment of our Essentials of Automations webinar series, we’ll explore the landscape of triggers and actions, guiding you through the nuances of authoring and adapting workspaces for seamless automations. Gain an understanding of the full spectrum of triggers and actions available in FME, empowering you to enhance your workspaces for efficient automation.
We’ll kick things off by showcasing the most commonly used event-based triggers, introducing you to various automation workflows like manual triggers, schedules, directory watchers, and more. Plus, see how these elements play out in real scenarios.
Whether you’re tweaking your current setup or building from the ground up, this session will arm you with the tools and insights needed to transform your FME usage into a powerhouse of productivity. Join us to discover effective strategies that simplify complex processes, enhancing your productivity and transforming your data management practices with FME. Let’s turn complexity into clarity and make your workspaces work wonders!
Goodbye Windows 11: Make Way for Nitrux Linux 3.5.0!SOFTTECHHUB
As the digital landscape continually evolves, operating systems play a critical role in shaping user experiences and productivity. The launch of Nitrux Linux 3.5.0 marks a significant milestone, offering a robust alternative to traditional systems such as Windows 11. This article delves into the essence of Nitrux Linux 3.5.0, exploring its unique features, advantages, and how it stands as a compelling choice for both casual users and tech enthusiasts.
HCL Notes and Domino License Cost Reduction in the World of DLAUpanagenda
Webinar Recording: https://www.panagenda.com/webinars/hcl-notes-and-domino-license-cost-reduction-in-the-world-of-dlau/
The introduction of DLAU and the CCB & CCX licensing model caused quite a stir in the HCL community. As a Notes and Domino customer, you may have faced challenges with unexpected user counts and license costs. You probably have questions on how this new licensing approach works and how to benefit from it. Most importantly, you likely have budget constraints and want to save money where possible. Don’t worry, we can help with all of this!
We’ll show you how to fix common misconfigurations that cause higher-than-expected user counts, and how to identify accounts which you can deactivate to save money. There are also frequent patterns that can cause unnecessary cost, like using a person document instead of a mail-in for shared mailboxes. We’ll provide examples and solutions for those as well. And naturally we’ll explain the new licensing model.
Join HCL Ambassador Marc Thomas in this webinar with a special guest appearance from Franz Walder. It will give you the tools and know-how to stay on top of what is going on with Domino licensing. You will be able lower your cost through an optimized configuration and keep it low going forward.
These topics will be covered
- Reducing license cost by finding and fixing misconfigurations and superfluous accounts
- How do CCB and CCX licenses really work?
- Understanding the DLAU tool and how to best utilize it
- Tips for common problem areas, like team mailboxes, functional/test users, etc
- Practical examples and best practices to implement right away
Sudheer Mechineni, Head of Application Frameworks, Standard Chartered Bank
Discover how Standard Chartered Bank harnessed the power of Neo4j to transform complex data access challenges into a dynamic, scalable graph database solution. This keynote will cover their journey from initial adoption to deploying a fully automated, enterprise-grade causal cluster, highlighting key strategies for modelling organisational changes and ensuring robust disaster recovery. Learn how these innovations have not only enhanced Standard Chartered Bank’s data infrastructure but also positioned them as pioneers in the banking sector’s adoption of graph technology.
GraphSummit Singapore | The Art of the Possible with Graph - Q2 2024Neo4j
Neha Bajwa, Vice President of Product Marketing, Neo4j
Join us as we explore breakthrough innovations enabled by interconnected data and AI. Discover firsthand how organizations use relationships in data to uncover contextual insights and solve our most pressing challenges – from optimizing supply chains, detecting fraud, and improving customer experiences to accelerating drug discoveries.
Full-RAG: A modern architecture for hyper-personalizationZilliz
Mike Del Balso, CEO & Co-Founder at Tecton, presents "Full RAG," a novel approach to AI recommendation systems, aiming to push beyond the limitations of traditional models through a deep integration of contextual insights and real-time data, leveraging the Retrieval-Augmented Generation architecture. This talk will outline Full RAG's potential to significantly enhance personalization, address engineering challenges such as data management and model training, and introduce data enrichment with reranking as a key solution. Attendees will gain crucial insights into the importance of hyperpersonalization in AI, the capabilities of Full RAG for advanced personalization, and strategies for managing complex data integrations for deploying cutting-edge AI solutions.
Building Production Ready Search Pipelines with Spark and MilvusZilliz
Spark is the widely used ETL tool for processing, indexing and ingesting data to serving stack for search. Milvus is the production-ready open-source vector database. In this talk we will show how to use Spark to process unstructured data to extract vector representations, and push the vectors to Milvus vector database for search serving.
TrustArc Webinar - 2024 Global Privacy SurveyTrustArc
How does your privacy program stack up against your peers? What challenges are privacy teams tackling and prioritizing in 2024?
In the fifth annual Global Privacy Benchmarks Survey, we asked over 1,800 global privacy professionals and business executives to share their perspectives on the current state of privacy inside and outside of their organizations. This year’s report focused on emerging areas of importance for privacy and compliance professionals, including considerations and implications of Artificial Intelligence (AI) technologies, building brand trust, and different approaches for achieving higher privacy competence scores.
See how organizational priorities and strategic approaches to data security and privacy are evolving around the globe.
This webinar will review:
- The top 10 privacy insights from the fifth annual Global Privacy Benchmarks Survey
- The top challenges for privacy leaders, practitioners, and organizations in 2024
- Key themes to consider in developing and maintaining your privacy program
UiPath Test Automation using UiPath Test Suite series, part 5DianaGray10
Welcome to UiPath Test Automation using UiPath Test Suite series part 5. In this session, we will cover CI/CD with devops.
Topics covered:
CI/CD with in UiPath
End-to-end overview of CI/CD pipeline with Azure devops
Speaker:
Lyndsey Byblow, Test Suite Sales Engineer @ UiPath, Inc.
Best 20 SEO Techniques To Improve Website Visibility In SERPPixlogix Infotech
Boost your website's visibility with proven SEO techniques! Our latest blog dives into essential strategies to enhance your online presence, increase traffic, and rank higher on search engines. From keyword optimization to quality content creation, learn how to make your site stand out in the crowded digital landscape. Discover actionable tips and expert insights to elevate your SEO game.
“An Outlook of the Ongoing and Future Relationship between Blockchain Technologies and Process-aware Information Systems.” Invited talk at the joint workshop on Blockchain for Information Systems (BC4IS) and Blockchain for Trusted Data Sharing (B4TDS), co-located with with the 36th International Conference on Advanced Information Systems Engineering (CAiSE), 3 June 2024, Limassol, Cyprus.
Removing Uninteresting Bytes in Software FuzzingAftab Hussain
Imagine a world where software fuzzing, the process of mutating bytes in test seeds to uncover hidden and erroneous program behaviors, becomes faster and more effective. A lot depends on the initial seeds, which can significantly dictate the trajectory of a fuzzing campaign, particularly in terms of how long it takes to uncover interesting behaviour in your code. We introduce DIAR, a technique designed to speedup fuzzing campaigns by pinpointing and eliminating those uninteresting bytes in the seeds. Picture this: instead of wasting valuable resources on meaningless mutations in large, bloated seeds, DIAR removes the unnecessary bytes, streamlining the entire process.
In this work, we equipped AFL, a popular fuzzer, with DIAR and examined two critical Linux libraries -- Libxml's xmllint, a tool for parsing xml documents, and Binutil's readelf, an essential debugging and security analysis command-line tool used to display detailed information about ELF (Executable and Linkable Format). Our preliminary results show that AFL+DIAR does not only discover new paths more quickly but also achieves higher coverage overall. This work thus showcases how starting with lean and optimized seeds can lead to faster, more comprehensive fuzzing campaigns -- and DIAR helps you find such seeds.
- These are slides of the talk given at IEEE International Conference on Software Testing Verification and Validation Workshop, ICSTW 2022.
Unlocking Productivity: Leveraging the Potential of Copilot in Microsoft 365, a presentation by Christoforos Vlachos, Senior Solutions Manager – Modern Workplace, Uni Systems
1. Fight the empire light weightly with
HTML5, WebSockets, Server-sent
Events and others
Bhakti Mehta
Twitter: @bhakti_mehta
2. Introduction
• Currently working as a Senior Software Engineer at
Blue Jeans Network. Bluejeans.com
• Worked at Sun Microsystems/Oracle for 13 years
• Committer to numerous open source projects
• Author of Developing RESTful Services with JAX-RS
2.0, WebSockets and JSON
Copyright 2013, Bhakti Mehta all rights reserved
4. Agenda
Introduction
Polling
Server- sent Events (SSE)
WebSockets
JAXRS 2.0
JSON-P
Copyright 2013, Bhakti Mehta all rights reserved
5. Polling
Used by vast majority of AJAX applications
Poll the server for data
Client --->request--> Server
If no data empty response is returned
Copyright 2013, Bhakti Mehta all rights reserved
6. Polling
Copyright 2013, Bhakti Mehta all rights reserved
Client Server
Request (client_id)
Response 200 OK: empty
Request (client_id)
….
….
….
….
Response 200 OK: message
body
7. Polling Drawbacks
Http overhead
Reducing the interval will consume more bandwidth
and processing resources for nothing.
Copyright 2013, Bhakti Mehta all rights reserved
8. Long Polling
If server does not have data holds request open
COMET
Chunked transfer encoding can be used to send
chunks of data as part of response body which is
opened as a stream.
Chunks can be javascript tags loaded in hidden
iframe and executed in order of arrival
Copyright 2013, Bhakti Mehta all rights reserved
9. Long Polling
Copyright 2013, Bhakti Mehta all rights reserved
Client Server
Request (client_id)
Response 200 OK: message body
Request (client_id)
….
….
….
Response 200 OK: message
body
….
….
10. Long Polling Drawbacks
• One-way communication
• No standard data format or message format when
used in chunked transfer encoding mode
• Each connection initiation has the initiation cost.
• No caching between clients and server, which
impacts the server performance instead of reading
some contents from the cache.
Copyright 2013, Bhakti Mehta all rights reserved
11. Server-sent events
Copyright 2013, Bhakti Mehta all rights reserved
Unidirectional channel between server and client
Server pushes data to your app when it wants
Updates can be streamed from server to client as they
happen
12. Server-sent Events
Copyright 2013, Bhakti Mehta all rights reserved
Client Server
Request (client_id)
….
….
….
SSE message
….
….
SSE message
13. Server-sent Events
Subscribing to event stream
To subscribe to an event stream, create an EventSource
object and pass it the URL of your stream:
Example in javascript
eventSource = new EventSource(url);
eventSource.onmessage = function (event) {
}
Setting up handlers for events
You can optionally listen for onopen() and onerror()
functions
Copyright 2013, Bhakti Mehta all rights reserved
14. Message format for SSE
Sending an event stream
Construct a plaintext response, served with a
text/event-stream Content-Type.
Sample message format
data: Help me Obi Wan-Kenobi you are my only
hopenn
Copyright 2013, Bhakti Mehta all rights reserved
15. Server-sent Events and
JSON
Sending JSON
You can send multiple lines without breaking JSON
format by sending messages like this
data: {nn
data: "name": Luke Skywalker",nn
data: ”home": Tatooinenn
data: }nn
On client side
source.addEventListener('message', function(e) {
var data = JSON.parse(e.data);
Copyright 2013, Bhakti Mehta all rights reserved
16. Associating event names
with SSE
event: order66Issuedn
data: {“issuer” : “Chancellor Palpatine”}nn
event: jedisPurgedn
data: {“survivor” :”Obi-Wan Kenobi, Yoda”}nn
Copyright 2013, Bhakti Mehta all rights reserved
17. Associating ids with SSE
Associating ids with events can help with fault
tolerance in SSE
id: 123 n
data: Battle of droids deployed at Naboonn
Copyright 2013, Bhakti Mehta all rights reserved
18. Connection loss and
retries
• Browsers that support SSE can try reconnecting to
the server in case the connection between browser
and server is severed. The default retry interval is
3000 milliseconds but it can be adjusted by
including the retry directive in the messages that
server sends to the client.
• For example to increase the retry interval to 5000
milliseconds SSE message that server sends can be
similar to the following listing:
retry: 5000n
data: This is a single line datann
Copyright 2013, Bhakti Mehta all rights reserved
19. Server-sent Events and
reconnection
If the connection drops, the EventSource fires an
error event and automatically tries to reconnect.
The server can also control the timeout before the
client tries to reconnect.
Copyright 2013, Bhakti Mehta all rights reserved
20. Best practices for Server-
sent Events
Check if eventSource's origin attribute is the
expected domain to get the message
if (e.origin != 'http://foo.com') {
alert('Origin was not http://foo.com');
return;
Copyright 2013, Bhakti Mehta all rights reserved
21. Best practices for Server-
sent Events
Associating an ID with an event
Setting an ID lets the browser keep track of the last
event fired
Incase connection is dropped a special Last-
Event-ID is set with new request
This lets the browser determine which event is
appropriate to fire. The message event contains
a e.lastEventId property.
Copyright 2013, Bhakti Mehta all rights reserved
22. Comparing Polling vs
Long Polling vs SSE
Polling: GET. If data, process data. GET...
1 GET = 1 HTTP response header and maybe a chunk of
data.
Long-polling: GET. Wait. Process data. GET...
1 GET = 1 HTTP response header and chunks of data.
SSE: GET. Wait. Process data. Wait. Process data. Wait...
1 GET = 1 HTTP response header and chunks of data with
small headers
Copyright 2013, Bhakti Mehta all rights reserved
23. WebSockets
Full duplex communication in either direction
Data is framed with 2 bytes
In the case of text frames, each frame starts with a
0x00 byte, ends with a 0xFF byte, and contains UTF-8
data in between.
Copyright 2013, Bhakti Mehta all rights reserved
24. WebSockets
Client and Server upgrade from Http protocol to
WebSocket protocol during initial handshake
GET /text HTTP/1.1rn
Upgrade: WebSocketrn
Connection: Upgradern
Host: www.websocket.orgrn …rn
Handshake from server looks like
HTTP/1.1 101 WebSocket Protocol Handshakern
Upgrade: WebSocketrn
Connection: Upgradern …rn
Copyright 2013, Bhakti Mehta all rights reserved
26. WebSockets
After the upgrade HTTP is completely out of the
picture at this point.
Using the lightweight WebSocket wire protocol,
messages can now be sent or received by either
endpoint at any time.
Creating a Websocket
ws = new WebSocket("ws://localhost:8080/../WebSocketChat");
You can set handlers for events onopen or onerror
Copyright 2013, Bhakti Mehta all rights reserved
27. WebSockets JSR 356
@ServerEndpoint
signifies that the Java class it decorates is to be
deployed as WebSocket endpoint
Additionally the following components can be
annotated with @ServerEndpoint
a stateless session EJB
a singleton EJB
a CDI managed bean
Copyright 2013, Bhakti Mehta all rights reserved
28. WebSockets and Security
A web socket which is mapped to a given ws://
URI is protected in the deployment descriptor with a
listing to a http:// URI with same hostname, port and
path
since this is the URL of its opening handshake
Copyright 2013, Bhakti Mehta all rights reserved
29. Comparisons
Subject SSE WebSockets Long Polling
Error Handling Built in support Built in support Almost no error
handling in
chunked transfer
Performance Better than long
polling and
inferior to
WebSockets
Best performance Small CPU
resource but idle
process/thread
per client
connection limits
scalability
Communication
channel
HTTP
unidirectional
WebSockets
bidirectional
Http
unidirectional
Copyright 2013, Bhakti Mehta all rights reserved
30. Comparisons
Subject SSE WebSockets Long Polling
Implementation
complexity
Easy Requires
websocket
support
Easiest
Browser Support Firefox,Chrome
Safari, Opera
For RFC 6455: IE
10, Firefox 11,
Chrome 16, Safari
6, Opera 12.10
All current
browsers
Copyright 2013, Bhakti Mehta all rights reserved
31. Best practices for
WebSockets
• Throttling the rate of sending data
• The WebSockets has a bufferedAmount attribute
which can be used to control the rate of sending
data. Using the bufferedAmount attribute you can
check the number of bytes that have been queue
but not yet sent to the server.
if (webSocket.bufferedAmount < THRESHOLD)
webSocket.send(someData);
};
Copyright 2013, Bhakti Mehta all rights reserved
32. Best practices for
WebSockets
• Controlling the maximum size of the message
• Use the maxMessageSize attribute on @OnMessage
annotation
• If the incoming message exceeds the maximum size
then the connection is closed. This is a good
practice to control the maximum size of a message
so that the client does not deplete its resources
trying to handle a message, which it can’t process.
Copyright 2013, Bhakti Mehta all rights reserved
33. Best practices for
WebSockets
• Use wss protocol with Proxy servers
• Proxy servers may not allow unencrypted Web
Socket traffic to flow through. Since the traffic is
encrypted there is a greater chance to pass
through the proxy server.
• Then the CONNECT statements will work and there
will be an end-to-end encrypted tunnel for web
sockets.
Copyright 2013, Bhakti Mehta all
rights reserved
35. RESTful Webservices
• Key principles of REST
• Associating IDs to resources
• Using standard HTTP methods
• Multiple formats data sent by a resource
• Statelessness
Copyright 2013, Bhakti Mehta all rights reserved
36. RESTful WebServices
• GET: The GET request retrieves a representation of a
resource from server to client.
• POST: The POST request is used to create a resource
on the server based on the representation that the
client sends.
• PUT: The PUT request is used to update or create a
reference to a resource on server.
• DELETE: The DELETE request can delete a resource
on server.
• HEAD: The HEAD requests checks for a resource
without retrieving it.
Copyright 2013, Bhakti Mehta all rights reserved
37. RESTful WebServices
• Safety
o Invoking a method does not change the
resource on server
o GET, HEAD are safe
o PUT, DELETE, POST are not safe
• Idempotence
o Calling a method multiple times will not change
the result
o GET, HEAD, PUT,DELETE are idempotent
o POST is not idempotent
Copyright 2013, Bhakti Mehta all rights reserved
38. JAX-RS 2.0
Defines how to expose POJOs as web resources,
using HTTP as the network protocol.
Applications using these APIs can be deployed to
an application server in a portable manner.
Copyright 2013, Bhakti Mehta all rights reserved
39. Resources and JAX-RS
1.Define a root resource
@Path(”jedis")
public class JediResource {
}
2. Define methods for resource and mime type
@GET
@Produces(“text/plain”)
public String getRank() {
return rank; // for eg Youngling, Padawan, Jedi Knight or Jedi
Master
}
Copyright 2013, Bhakti Mehta all rights reserved
40. SubResources and JAX-RS
1.Define a sub resource
@Path("/jedis")
public class JediResource {
@Path(”/jedi/{name}")
public Jedi getJedi(@PathParam(”name") String name){
//return Jedi
}
public class Jedi {
@Path(”/apprentice")
public String getApprentice(){
}
}
Copyright 2013, Bhakti Mehta all rights reserved
41. SubResources and JAX-RS
• If request is GET /jedis/Yodas
• The JediResource.getJedi() method will be invoked.
• If a client sends a request using the URI
• GET /jedis/Yoda/apprentice
• Jedi object is returned and getApprentice()
method is invoked
Copyright 2013, Bhakti Mehta all rights reserved
42. Client API for JAX-RS 2.0
• Client client = ClientBuilder.newClient();
• WebTarget target = client.target(URI);
• String jedi = target.request().get(String.class);
Copyright 2013, Bhakti Mehta all rights reserved
43. JAX-RS 2.0
Client API
Filters and Interceptors
Client-side and Server-side Asynchronous
Improved Connection Negotiation
Alignment with JSR 330
Copyright 2013, Bhakti Mehta all rights reserved
44. Java API for JSON
Processing JSON-P
Streaming API to produce/consume JSON
Similar to StAX API in XML world
Object model API to represent JSON
Similar to DOM API in XML world
Copyright 2013, Bhakti Mehta all rights reserved
45. JsonParser
JsonParser – Parses JSON in a streaming way from
input sources
Similar to StAX’s XMLStreamReader, a pull parser
Created
Parser state events :
START_ARRAY, START_OBJECT, KEY_NAME, VALUE_STRING,
VALUE_NUMBER, VALUE_TRUE, VALUE_FALSE, VALUE_NULL,
END_OBJECT, END_ARRAY
Created using :
Json.createParser(…),
Json.createParserFactory().createParser(…)
Copyright 2013, Bhakti Mehta all rights reserved
46. JsonGenerator
JsonGenerator – Generates JSON in a streaming
way to output sources
Similar to StAX’s XMLStreamWriter
Created using :
Json.createGenerator(…),
Json.createGeneratorFactory().createGenerator(…)
Copyright 2013, Bhakti Mehta all rights reserved
47. JsonReader
Reads JsonObject and JsonArray from
input source
Uses pluggable JsonParser
try (JsonReader reader = new JsonReader(io)) {
JsonObject obj = reader.readObject();
}
Copyright 2013, Bhakti Mehta all rights reserved
48. JsonWriter
Writes JsonObject and JsonArray to
output source
Uses pluggable JsonGenerator
// Writes a JSON object
try (JsonWriter writer = new JsonWriter(io)) {
writer.writeObject(obj);
}
Copyright 2013, Bhakti Mehta all rights reserved
49. JSON sample data
{
”name": "Jar Jar Binks”, ”home": “Naboo”,
”affilitation": [
{ "type": ”primary", "name": ”Royal
House of Naboo" },
{ "type": ”secondary", "name":
”Galactic republic" }]}
]
}
Copyright 2013, Bhakti Mehta all rights reserved
50. Call for action
• Download GlassFish 4.0 from glassfish.dev.java.net
• File issues, contribute patches
• Email users@glassfish.dev.java.net
Copyright 2013, Bhakti Mehta all rights reserved
51. Questions
• Twitter: @bhakti_mehta
• Blog https://www.java.net//blogs/bhaktimehta
• LinkedIn: http://www.linkedin.com/in/bhaktihmehta
• May the force be with you!!
Copyright 2013, Bhakti Mehta all rights reserved