The document discusses how to develop responsive applications with Java EE7. It focuses on using asynchronous processing and non-blocking I/O to maximize throughput and handle many requests. Key technologies discussed include JAX-RS 2.0 asynchronous processing, the Concurrency Utilities, the WebSocket API, and non-blocking I/O in Servlet 3.1. Code examples are provided for implementing asynchronous processing using these different Java EE 7 technologies.
ASP.NET MVC 4 Request Pipeline InternalsLukasz Lysik
This is a presentation about ASP.NET MVC 4 request pipeline, presented on Study Group meeting. It mainly contains analysis of MVC framework's source code.
ASP.NET MVC 4 Request Pipeline InternalsLukasz Lysik
This is a presentation about ASP.NET MVC 4 request pipeline, presented on Study Group meeting. It mainly contains analysis of MVC framework's source code.
This talk introduces some of the compelling features coming in Spring 3.1, 3.2 and then gazes into the future and looks at some of the powerful new features in the upcoming Spring 4.0 release.
Creating Modular Test-Driven SPAs with Spring and AngularJSGunnar Hillert
Single-page Applications (SPA) are all the rage these days and with them there is an avalanche of new tools, libraries and frameworks we need to know. But what does this mean for us as Spring developers? In this session we will give you an overview of the current landscape and illustrate the choices the Spring XD team has made for its user interface. What do I use to write SPA applications? How do I integrate them into existing Spring-based backends? How do I build them? Can I integrate them into my existing Gradle or Maven build processes in order to achieve complete build automation? How do I integrate realtime messaging using Spring's SockJS/WebSocket support? In this talk we will answer these and many more questions. We will cover frameworks such as AngularJS, Bootstrap, RequireJS; tools like Bower, Grunt, Gulp; and also talk about testing using Karma and Protractor.
Have you ever used Oracle WebLogic Server? If the answer is no, this presentation is for you. We explain core WebLogic Server concepts and perform a live walkthrough of the console covering core administration areas that include managed servers, JVM servers, JMS resources, logs, data sources, application deployments, and more.
From the AJUG meeting: http://www.meetup.com/atlantajug/events/222312943/
Oc 20, 2015
In this fully-loaded session we will give you an update on all things Spring. We will talk about the latest features in Spring Framework 4.2 which was released this summer, and also provide an outlook to what is coming with Spring 5 in 2016.
Next, Spring Boot 1.3 is on the horizon and adds many new features. We will go over those and explain how Spring Boot helps you build production-ready Spring applications.
And then we add Spring Cloud to the mix and explain the various modules
Changes in WebLogic 12.1.3 Every Administrator Must KnowBruno Borges
WebLogic 12c has evolved quite a lote since its first release (12.1.1). Now on 12.1.3 it has more to offer, optimizations for Exalogic, support of some Java EE 7 APIs and more.
JDK.IO 2016 (http://jdk.io)
Java EE 7 introduced a new batch processing API. This session will go over how to use the batch processing API introduced with Java EE 7. This API is makes it easy to implement long running data/compute intensive jobs which need to be scheduled or initiated on-demand. Basics of the API will be demonstrated via code samples. The API will also be compared to Spring Batching and Hadoop to provide context and guidance on when these technologies are appropriate.
A general- ‐purpose build automation tool. It can automate building, testing, deployment, publishing, generate documentation etc.
Designed to take advantage of convention over configuration.
Combines the power and flexibility of Ant with the dependency management and
conventions of Maven into a more effective way to build.
In this fully-loaded session we will give you an update on all things Spring. We will talk about the latest features in Spring Framework 4.2 which was released this summer, and also provide an outlook to what is coming with Spring 5 in 2016.
Next, Spring Boot 1.3 is on the horizon and adds many new features. We will go over those and explain how Spring Boot helps you build production-ready Spring applications.
And then we add Spring Cloud to the mix and explain the various modules.
Oracle WebLogic Server 12c introduces RESTful Management Services, allowing anyone to query and monitor numerous Oracle WebLogic Server metrics from a multitude of programming languages, including mobiles devices. We also introduce a tool we've developed that supports mobile monitoring, management, and alerting of Oracle WebLogic Server and would like to share our architecture and design.
IBM WebSphere Application Foundation Sessions at IBM InterConnect 2015ibmwebspheresoftware
An overview of all of the key sessions at IBM InterConnect 2015 for the WebSphere Application Foundation portfolio, including:
- WebSphere Application Server including Liberty profile
- Extreme Scale
- PureSystems (WAS related)
- Bluemix (runtimes related)
- WebSphere Application Server Developer Tools
To build your InterConnect agenda online or import sessions into your calendar, visit: ibm.co/interconnectagendabuilder
To register for IBM InterConnect, visit: http://ibm.co/interconnect
This talk introduces some of the compelling features coming in Spring 3.1, 3.2 and then gazes into the future and looks at some of the powerful new features in the upcoming Spring 4.0 release.
Creating Modular Test-Driven SPAs with Spring and AngularJSGunnar Hillert
Single-page Applications (SPA) are all the rage these days and with them there is an avalanche of new tools, libraries and frameworks we need to know. But what does this mean for us as Spring developers? In this session we will give you an overview of the current landscape and illustrate the choices the Spring XD team has made for its user interface. What do I use to write SPA applications? How do I integrate them into existing Spring-based backends? How do I build them? Can I integrate them into my existing Gradle or Maven build processes in order to achieve complete build automation? How do I integrate realtime messaging using Spring's SockJS/WebSocket support? In this talk we will answer these and many more questions. We will cover frameworks such as AngularJS, Bootstrap, RequireJS; tools like Bower, Grunt, Gulp; and also talk about testing using Karma and Protractor.
Have you ever used Oracle WebLogic Server? If the answer is no, this presentation is for you. We explain core WebLogic Server concepts and perform a live walkthrough of the console covering core administration areas that include managed servers, JVM servers, JMS resources, logs, data sources, application deployments, and more.
From the AJUG meeting: http://www.meetup.com/atlantajug/events/222312943/
Oc 20, 2015
In this fully-loaded session we will give you an update on all things Spring. We will talk about the latest features in Spring Framework 4.2 which was released this summer, and also provide an outlook to what is coming with Spring 5 in 2016.
Next, Spring Boot 1.3 is on the horizon and adds many new features. We will go over those and explain how Spring Boot helps you build production-ready Spring applications.
And then we add Spring Cloud to the mix and explain the various modules
Changes in WebLogic 12.1.3 Every Administrator Must KnowBruno Borges
WebLogic 12c has evolved quite a lote since its first release (12.1.1). Now on 12.1.3 it has more to offer, optimizations for Exalogic, support of some Java EE 7 APIs and more.
JDK.IO 2016 (http://jdk.io)
Java EE 7 introduced a new batch processing API. This session will go over how to use the batch processing API introduced with Java EE 7. This API is makes it easy to implement long running data/compute intensive jobs which need to be scheduled or initiated on-demand. Basics of the API will be demonstrated via code samples. The API will also be compared to Spring Batching and Hadoop to provide context and guidance on when these technologies are appropriate.
A general- ‐purpose build automation tool. It can automate building, testing, deployment, publishing, generate documentation etc.
Designed to take advantage of convention over configuration.
Combines the power and flexibility of Ant with the dependency management and
conventions of Maven into a more effective way to build.
In this fully-loaded session we will give you an update on all things Spring. We will talk about the latest features in Spring Framework 4.2 which was released this summer, and also provide an outlook to what is coming with Spring 5 in 2016.
Next, Spring Boot 1.3 is on the horizon and adds many new features. We will go over those and explain how Spring Boot helps you build production-ready Spring applications.
And then we add Spring Cloud to the mix and explain the various modules.
Oracle WebLogic Server 12c introduces RESTful Management Services, allowing anyone to query and monitor numerous Oracle WebLogic Server metrics from a multitude of programming languages, including mobiles devices. We also introduce a tool we've developed that supports mobile monitoring, management, and alerting of Oracle WebLogic Server and would like to share our architecture and design.
IBM WebSphere Application Foundation Sessions at IBM InterConnect 2015ibmwebspheresoftware
An overview of all of the key sessions at IBM InterConnect 2015 for the WebSphere Application Foundation portfolio, including:
- WebSphere Application Server including Liberty profile
- Extreme Scale
- PureSystems (WAS related)
- Bluemix (runtimes related)
- WebSphere Application Server Developer Tools
To build your InterConnect agenda online or import sessions into your calendar, visit: ibm.co/interconnectagendabuilder
To register for IBM InterConnect, visit: http://ibm.co/interconnect
This presentation provide a view on the differences between WebSphere Application Server and Liberty Profile vs. competitive offerings, such as Apache Tomcat, Red Hat JBoss and Oracle WebLogic. It covers both the technical (feature/function) as well as cost considerations (TCA, TCO).
The Liberty Deep Dive presentation from IBM InterConnect 2017. This presentation covers some of the key technical details of Liberty, some production deployment options, and what has changed between March 2016 and March 2017.
Don't Wait! Develop responsive applications with Java EE7 insteadErin Schnabel
A revision to a previous session: we explore how the async mechanisms in Java EE7 help you be more responsive in the backend. Includes an overview of how EE7 technologies enable RxJava to be used in a container-friendly way.
The world of open source libraries and tools is vast for Android developers. Writing apps using solely Android SDK is impractical. Libraries can help you in many ways. They can speed up your development, save you creating boilerplate code and dealing with platform fragmentation, simplify your code and make it more readable and maintainable. In the talk I’m showing how several truly useful libraries can help a developer.
Presented at MobCon Europe 2017.
Building Scalable Stateless Applications with RxJavaRick Warren
RxJava is a lightweight open-source library, originally from Netflix, that makes it easy to compose asynchronous data sources and operations. This presentation is a high-level intro to this library and how it can fit into your application.
Boost Development With Java EE7 On EAP7 (Demitris Andreadis)Red Hat Developers
JBoss EAP7 brings support for the most recent industry standards and technologies, including Java EE7, the latest edition of the premier enterprise development standard. This session will provide an overview of the major additions to Java EE7, and how your team can use these capabilities on the advanced EAP7 runtime to produce better applications with less code.
Going fullstack React(ive) - Paulo Lopes - Codemotion Amsterdam 2017Codemotion
What if someone told you that you could use the full capacity of your server? That you could have the same performance on the backend as your react frontend? Don't you believe it? That you could choose the best language/tool for the task and you were not limited by what you already know? In this talk, I'll show you that you can use the full power of React on the frontend and Vert.x on the backend. You will see a fast full stack development workflow with Rollup/Webpack + Babel + React. How you can mix JavaScript with any other language. Build microservice applications in minutes.
Tamir Dresher - What’s new in ASP.NET Core 6Tamir Dresher
ASP.NET Core is a modern Web framework for .NET that gives you everything you need to build powerful backend services.
With .NET 6 things are simpler than ever before and there are many new features that will make your development fun and fast.
In this session we'll explore all the cool and new things that were added and all that changes that make ASP.NET Core 6 the best web framework
SOAP Web Services have a well established role in the enterprise, but aside from the many benefits of the WS-* standards, SOAP and XML also carry additional baggage for developers. Consequently, REST Web Services are gaining tremendous popularity within the developer community. This session will begin by comparing and contrasting the basic concepts of both SOAP and REST Web Services. Building on that foundation, Sam Brannen will show attendees how to implement SOAP-based applications using Spring-WS 2.0. He will then demonstrate how to build a similar REST-ful application using Spring MVC 3.0. The session will conclude with an in-depth look at both server-side and client-side development as well as efficient integration testing of Web Services using the Spring Framework.
ASZ-3034 Build a WebSphere Linux Cloud on System z: From Roll-Your-Own to Pre...WASdev Community
Do you need the most reliable, secure, and cost-effective on-premise cloud platform? Look no further: a cloud based on WebSphere and Linux on System z is the answer. This presentation traces the evolution of successful server consolidation to Linux on System z, from brute-force physical moves to virtual topology to sophisticated workload placement. We'll cover techniques and considerations to ensure a rich, dense, enterprise environment. The material is derived from interactions with our enterprise mainframe customers running world-class data centers.
We will briefly describe the new Enterprise Cloud System that unites leading IBM software, storage, and server technologies into one simple, flexible, and secure factory-integrated solution.
We will show examples of System z based cloud environments which provide everything you expect from System z: extreme reliability, secure, geo-dispersed, high performance clouds. We will describe application development and deployment patterns that both help and hurt in a virtualized cloud environment. From the admin perspective we will explore heap and GC tuning, idle server tuning, and stacking options. We will also present a very effective performance tuning approach for large scale virtualized environments.
We also present WebSphere Liberty profile performance in a virtualized environment, relative to a traditional WebSphere application server.
Deploy, Monitor and Manage in Style with WebSphere Liberty Admin CenterWASdev Community
The WebSphere Application Server Liberty profile with Liberty Administrative Center provides a browser-based interface for deploying, monitoring, and managing WebSphere Liberty environments, from single servers to large collectives with clusters and auto-scaling. Learn about Liberty Admin Center, its use and future directions.
AAI-2075 Evolving an IBM WebSphere Topology to Manage a Changing WorkloaWASdev Community
Customers have a huge investment in WebSphere ND infrastructure including installation, development, deployment, management, support, and 3rd party products. At the same time there are significant new workloads. Mobile is driving very high transaction rates using new device types. New applications often require extremely fast response times. The Cloud economy based on Restful services is rapidly expanding the very nature of applications. Meanwhile, teams need to improve efficiency and drive higher density on their platforms.
In this session we will show you how to evolve your WebSphere ND environment to manage new workloads while preserving your existing investment. See how to add Liberty servers into ND. Explore how Intelligent Management and the ODR extend ND to support Restful services. Examine the benefits of a caching tier to improve response time and availability. See how to add Worklight into your ND environment to provide mobile device and application support. Explore continuous delivery and devOps options for WebSphere ND.
AAI-1305 Choosing WebSphere Liberty for Java EE DeploymentsWASdev Community
The Liberty profile was added to the WebSphere Application Server product in 2012, providing a massive boost to development efficiency for Java EE applications, and a very flexible runtime for agile deployment. The past two years have seen a rapid expansion in the programming model, management and security capabilities of Liberty and it is now a serious choice for large scale deployments of Java EE applications. These slides discuss the use of Liberty for production deployments.
AAI-1304 Technical Deep-Dive into IBM WebSphere LibertyWASdev Community
A detailed look into the philosophy, architecture and design of the most flexible, simple and scalable Java EE Application Server on the market today; the WebSphere Liberty profile. These slides describe the motivation behind this project, and the key characteristics that are encouraging so many Java EE users to move their applications to Liberty.
Arduinos, application servers, and me: Adventures in and out of the cloudWASdev Community
At QCON London 2015, Holly gave this talk in which she explores the limits of embeddable hardware and presents a getting-started-guide to the internet of things. What’s needed? How much does it cost? What’s the best way of making an embeddable device talk to the internet? She also gave a demo of the cuddleable, throwable application server she created.
JMeter webinar - integration with InfluxDB and GrafanaRTTS
Watch this recorded webinar about real-time monitoring of application performance. See how to integrate Apache JMeter, the open-source leader in performance testing, with InfluxDB, the open-source time-series database, and Grafana, the open-source analytics and visualization application.
In this webinar, we will review the benefits of leveraging InfluxDB and Grafana when executing load tests and demonstrate how these tools are used to visualize performance metrics.
Length: 30 minutes
Session Overview
-------------------------------------------
During this webinar, we will cover the following topics while demonstrating the integrations of JMeter, InfluxDB and Grafana:
- What out-of-the-box solutions are available for real-time monitoring JMeter tests?
- What are the benefits of integrating InfluxDB and Grafana into the load testing stack?
- Which features are provided by Grafana?
- Demonstration of InfluxDB and Grafana using a practice web application
To view the webinar recording, go to:
https://www.rttsweb.com/jmeter-integration-webinar
GDG Cloud Southlake #33: Boule & Rebala: Effective AppSec in SDLC using Deplo...James Anderson
Effective Application Security in Software Delivery lifecycle using Deployment Firewall and DBOM
The modern software delivery process (or the CI/CD process) includes many tools, distributed teams, open-source code, and cloud platforms. Constant focus on speed to release software to market, along with the traditional slow and manual security checks has caused gaps in continuous security as an important piece in the software supply chain. Today organizations feel more susceptible to external and internal cyber threats due to the vast attack surface in their applications supply chain and the lack of end-to-end governance and risk management.
The software team must secure its software delivery process to avoid vulnerability and security breaches. This needs to be achieved with existing tool chains and without extensive rework of the delivery processes. This talk will present strategies and techniques for providing visibility into the true risk of the existing vulnerabilities, preventing the introduction of security issues in the software, resolving vulnerabilities in production environments quickly, and capturing the deployment bill of materials (DBOM).
Speakers:
Bob Boule
Robert Boule is a technology enthusiast with PASSION for technology and making things work along with a knack for helping others understand how things work. He comes with around 20 years of solution engineering experience in application security, software continuous delivery, and SaaS platforms. He is known for his dynamic presentations in CI/CD and application security integrated in software delivery lifecycle.
Gopinath Rebala
Gopinath Rebala is the CTO of OpsMx, where he has overall responsibility for the machine learning and data processing architectures for Secure Software Delivery. Gopi also has a strong connection with our customers, leading design and architecture for strategic implementations. Gopi is a frequent speaker and well-known leader in continuous delivery and integrating security into software delivery.
DevOps and Testing slides at DASA ConnectKari Kakkonen
My and Rik Marselis slides at 30.5.2024 DASA Connect conference. We discuss about what is testing, then what is agile testing and finally what is Testing in DevOps. Finally we had lovely workshop with the participants trying to find out different ways to think about quality and testing in different parts of the DevOps infinity loop.
Connector Corner: Automate dynamic content and events by pushing a buttonDianaGray10
Here is something new! In our next Connector Corner webinar, we will demonstrate how you can use a single workflow to:
Create a campaign using Mailchimp with merge tags/fields
Send an interactive Slack channel message (using buttons)
Have the message received by managers and peers along with a test email for review
But there’s more:
In a second workflow supporting the same use case, you’ll see:
Your campaign sent to target colleagues for approval
If the “Approve” button is clicked, a Jira/Zendesk ticket is created for the marketing design team
But—if the “Reject” button is pushed, colleagues will be alerted via Slack message
Join us to learn more about this new, human-in-the-loop capability, brought to you by Integration Service connectors.
And...
Speakers:
Akshay Agnihotri, Product Manager
Charlie Greenberg, Host
State of ICS and IoT Cyber Threat Landscape Report 2024 previewPrayukth K V
The IoT and OT threat landscape report has been prepared by the Threat Research Team at Sectrio using data from Sectrio, cyber threat intelligence farming facilities spread across over 85 cities around the world. In addition, Sectrio also runs AI-based advanced threat and payload engagement facilities that serve as sinks to attract and engage sophisticated threat actors, and newer malware including new variants and latent threats that are at an earlier stage of development.
The latest edition of the OT/ICS and IoT security Threat Landscape Report 2024 also covers:
State of global ICS asset and network exposure
Sectoral targets and attacks as well as the cost of ransom
Global APT activity, AI usage, actor and tactic profiles, and implications
Rise in volumes of AI-powered cyberattacks
Major cyber events in 2024
Malware and malicious payload trends
Cyberattack types and targets
Vulnerability exploit attempts on CVEs
Attacks on counties – USA
Expansion of bot farms – how, where, and why
In-depth analysis of the cyber threat landscape across North America, South America, Europe, APAC, and the Middle East
Why are attacks on smart factories rising?
Cyber risk predictions
Axis of attacks – Europe
Systemic attacks in the Middle East
Download the full report from here:
https://sectrio.com/resources/ot-threat-landscape-reports/sectrio-releases-ot-ics-and-iot-security-threat-landscape-report-2024/
Let's dive deeper into the world of ODC! Ricardo Alves (OutSystems) will join us to tell all about the new Data Fabric. After that, Sezen de Bruijn (OutSystems) will get into the details on how to best design a sturdy architecture within ODC.
Neuro-symbolic is not enough, we need neuro-*semantic*Frank van Harmelen
Neuro-symbolic (NeSy) AI is on the rise. However, simply machine learning on just any symbolic structure is not sufficient to really harvest the gains of NeSy. These will only be gained when the symbolic structures have an actual semantics. I give an operational definition of semantics as “predictable inference”.
All of this illustrated with link prediction over knowledge graphs, but the argument is general.
LF Energy Webinar: Electrical Grid Modelling and Simulation Through PowSyBl -...DanBrown980551
Do you want to learn how to model and simulate an electrical network from scratch in under an hour?
Then welcome to this PowSyBl workshop, hosted by Rte, the French Transmission System Operator (TSO)!
During the webinar, you will discover the PowSyBl ecosystem as well as handle and study an electrical network through an interactive Python notebook.
PowSyBl is an open source project hosted by LF Energy, which offers a comprehensive set of features for electrical grid modelling and simulation. Among other advanced features, PowSyBl provides:
- A fully editable and extendable library for grid component modelling;
- Visualization tools to display your network;
- Grid simulation tools, such as power flows, security analyses (with or without remedial actions) and sensitivity analyses;
The framework is mostly written in Java, with a Python binding so that Python developers can access PowSyBl functionalities as well.
What you will learn during the webinar:
- For beginners: discover PowSyBl's functionalities through a quick general presentation and the notebook, without needing any expert coding skills;
- For advanced developers: master the skills to efficiently apply PowSyBl functionalities to your real-world scenarios.
"Impact of front-end architecture on development cost", Viktor TurskyiFwdays
I have heard many times that architecture is not important for the front-end. Also, many times I have seen how developers implement features on the front-end just following the standard rules for a framework and think that this is enough to successfully launch the project, and then the project fails. How to prevent this and what approach to choose? I have launched dozens of complex projects and during the talk we will analyze which approaches have worked for me and which have not.
Slack (or Teams) Automation for Bonterra Impact Management (fka Social Soluti...Jeffrey Haguewood
Sidekick Solutions uses Bonterra Impact Management (fka Social Solutions Apricot) and automation solutions to integrate data for business workflows.
We believe integration and automation are essential to user experience and the promise of efficient work through technology. Automation is the critical ingredient to realizing that full vision. We develop integration products and services for Bonterra Case Management software to support the deployment of automations for a variety of use cases.
This video focuses on the notifications, alerts, and approval requests using Slack for Bonterra Impact Management. The solutions covered in this webinar can also be deployed for Microsoft Teams.
Interested in deploying notification automations for Bonterra Impact Management? Contact us at sales@sidekicksolutionsllc.com to discuss next steps.
Builder.ai Founder Sachin Dev Duggal's Strategic Approach to Create an Innova...Ramesh Iyer
In today's fast-changing business world, Companies that adapt and embrace new ideas often need help to keep up with the competition. However, fostering a culture of innovation takes much work. It takes vision, leadership and willingness to take risks in the right proportion. Sachin Dev Duggal, co-founder of Builder.ai, has perfected the art of this balance, creating a company culture where creativity and growth are nurtured at each stage.
2. Focus on the server side
• “Responsive” application
• Throughput is king (or queen)
• Should be able to handle as many requests as we can!
• Maximize resource utilization
• Make the best use of allocated resources
• Take advantage of tiered services
• Technologies in EE7 can help
• JAX-RS 2.0 async processing
• Concurrency Utilities (JSR-236)
• WebSocket API (JSR-356)
• Non-blocking I/O added in Servlet 3.1
1
5. A (very) simple JAX-RS example
@Path(”items")
public class ItemResource {
// various ways to get this guy, play nice and assume we have one
protected ItemService itemService;
@GET
@Produces(MediaType.APPLICATION_JSON)
public Collection<Item> listItems() {
return itemService.listItems();
}
@POST
@Consumes(MediaType.APPLICATION_JSON)
public void addItem(Item item) {
itemService.addItem(item);
}
...
}
4
6. A (very) simple JAX-RS example
@Path(”items")
public class ItemResource {
// various ways to get this guy, play nice and assume we have one
protected ItemService itemService;
@GET
@Produces(MediaType.APPLICATION_JSON)
public Collection<Item> listItems() {
return itemService.listItems();
}
@POST
@Consumes(MediaType.APPLICATION_JSON)
public void addItem(Item item) {
itemService.addItem(item);
}
...
}
5
What if this is an
encapsulation of a
remote service?
7. A (very) simple JAX-RS example
@Path(”items")
public class ItemResource {
// various ways to get this guy, play nice and assume we have one
protected ItemService itemService;
@GET
@Produces(MediaType.APPLICATION_JSON)
public Collection<Item> listItems() {
return itemService.listItems();
}
@POST
@Consumes(MediaType.APPLICATION_JSON)
public void addItem(Item item) {
itemService.addItem(item);
}
...
}
6
What if this is an
encapsulation of a
remote service?
Not much changes from
the client point of view:
they will make a
request and wait for the
response either way…
8. A (very) simple JAX-RS example
@Path(”items")
public class ItemResource {
// various ways to get this guy, play nice and assume we have one
protected ItemService itemService;
@GET
@Produces(MediaType.APPLICATION_JSON)
public Collection<Item> listItems() {
return itemService.listItems();
}
@POST
@Consumes(MediaType.APPLICATION_JSON)
public void addItem(Item item) {
itemService.addItem(item);
}
...
}
7
What if this is an
encapsulation of a
remote service?
Not much changes from
the client point of view:
they will make a
request and wait for the
response either way…
If the remote service
operation takes awhile, this
server thread…
… just sits there…
… waiting…
9. • AsyncResponse.resume(…) to send the response to the client.
• @Suspended annotation with AsyncResponse parameter
• void return type (to allow this method to return immediately)
• “suspend” the connection -- NOT DISCONNECTED!
@GET
@Produces(MediaType.APPLICATION_JSON)
public void getItems(@Suspended final AsyncResponse ar) {
Collection<Item> result = itemService.listItems();
ar.resume(result );
}
JAX-RS 2.0: Asynchronous processing
8
10. • AsyncResponse.resume(…) to send the response to the client.
• @Suspended annotation with AsyncResponse parameter
• void return type (to allow this method to return immediately)
• “suspend” the connection -- NOT DISCONNECTED!
@GET
@Produces(MediaType.APPLICATION_JSON)
public void getItems(@Suspended final AsyncResponse ar) {
Collection<Item> result = itemService.listItems();
ar.resume(result );
}
JAX-RS 2.0: Asynchronous processing
9
Hmm…I don’t see any
threading stuff. How is this
asynchronous?
Good catch!
So far, all we’ve achieved is parity
with what we had before… Choices, choices.
How to queue long-running
work onto a different thread?
11. JAX-RS 2.0 and….
10
@GET
@Produces(MediaType.APPLICATION_JSON)
public void getItems(@Suspended final AsyncResponse ar) {
Executors.newSingleThreadExecutor().submit(new Runnable() {
Collection<Item> result = itemService.listItems();
Response resp = Response.ok(result).build();
ar.resume(resp);
});
}
This would totally work:
The long-running operation is
definitely on a different thread.
Hopefully we also know that this
is a horrible idea!
#notcontainerfriendly
12. • For an EJB, use the @Asynchronous method annotation.
JAX-RS 2.0 and EJB
11
The EJB Container will
dispatch to a different thread
before invoking the method.
@Stateless
@Path("ejbitems")
public class ItemEJBResource {
...
@GET
@Asynchronous
@Produces(MediaType.APPLICATION_JSON)
public void getItems(@Suspended final AsyncResponse ar) {
Collection<Item> result = itemService.listItems();
Response resp = Response.ok(result).build();
ar.resume(resp);
}
...
}
13. JAX-RS 2.0 and CDI and Concurrency Utilities
12
• Enable CDI (beans.xml), and have an Executor provided
@Path("cdiexecitems")
public class ItemsCDIExecutorResource {
...
@Resource
ManagedExecutorService executor;
@GET
@Produces(MediaType.APPLICATION_JSON)
public void getItems(@Suspended final AsyncResponse ar) {
executor.submit(new Runnable() {
public void run() {
Collection<Item> result = itemService.listItems();
Response resp = Response.ok(result).build();
ar.resume(resp);
}
});
}
}
14. @Path("execitems")
public class ItemsExecutorResource {
private ExecutorService getExecutor() throws NamingException {
return (ExecutorService) new InitialContext()
.lookup("java:comp/DefaultManagedExecutorService");
}
@GET
@Produces(MediaType.APPLICATION_JSON)
public void getItems(@Suspended final AsyncResponse ar) {
Runnable r = new Runnable() {...};
try {
ExecutorService executor = getExecutor();
executor.submit(r);
} catch (NamingException e) {
r.run();
}
}
...
}
JAX-RS 2.0 and Concurrency Utilities
13
JNDI lookup for
managed executor
15. JAX-RS 2.0: Time out!
14
@Path("cdiexecitemsTimeout")
public class ItemsCDIExecutorResourceTimeout {
...
public void getItems(@Suspended final AsyncResponse ar) {
ar.setTimeout(500, TimeUnit.MILLISECONDS);
ar.setTimeoutHandler(new TimeoutHandler() {
public void handleTimeout(AsyncResponse arg0) {
ar.resume(Response.ok("Backup plan!").build());
}
});
executor.submit(new Runnable() {
public void run() {
Collection<Item> result = itemService.listItems();
Response resp = Response.ok(result).build();
ar.resume(resp);
}
});
}
}
16. • Register callbacks on AsyncResponse:
• ConnectionCallback is optionally supported, YMMV
ar.register(new CompletionCallback() {
@Override
public void onComplete(Throwable t) {
System.out.println("DONE! ");
if ( t != null ) {
t.printStackTrace();
}
}
});
ar.register(new ConnectionCallback() {
@Override
public void onDisconnect(AsyncResponse ar) {
System.out.println("Disconnected: " + ar);
}
});
JAX-RS 2.0: Callbacks
15
17. Concurrency Utilities
• Extension of java.util.concurrent (familiar API)
• ManagedExecutorService
java:comp/DefaultManagedExecutorService
• ManagedScheduledExecutorService
java:comp/DefaultManagedScheduledExecutorService
• ManagedThreadFactory
java:comp/DefaultManagedThreadFactory
• ContextService
java:comp/DefaultContextService
• Container-friendly mechanisms to queue and manage work
• Java EE Context propagation
– JNDI, classloader, security, etc.
• Allows container to manage async work, too!
16
19. Non-blocking I/O in Servlet 3.1
• Builds on Asynchronous processing from Servlet 3.0
• Only works for async-enabled apps
• Enables reading/writing data without blocking a thread
• ReadListener on ServletInputStream
• WriteListener on ServletOutputStream
• Best used with slow clients
• For clients that are slow to read data, use a WriteListener
• For clients that are slow to write data, use a ReadListener
18
20. Code Samples – Aync Servlet Listener
19
// start async
AsyncContext ac = request.startAsync();
// set up async listener
ac.addListener(new AsyncListener() {
@Override
public void onComplete(AsyncEvent event) throws IOException {
System.out.println("AsyncServlet onComplete() called");
}
@Override
public void onError(AsyncEvent event) {
System.out.println("AsyncServlet onError() " + event.getThrowable());
}
@Override
public void onStartAsync(AsyncEvent event) {
System.out.println("AsyncServlet onStartAsync()");
}
@Override
public void onTimeout(AsyncEvent event) {
System.out.println("AsyncServlet onTimeout()");
}
}, request, response);
21. Code Samples – Non-Blocking I/O
20
final ServletInputStream is = request.getInputStream();
// Start NIO Mode!! May only be called once…
// Can not use regular servlet input stream read/write after this
is.setReadListener(new AsyncReadListener(...));
public class AsyncReadListener implements ReadListener {
@Override
public void onDataAvailable() throws IOException {
System.out.println("AsyncReadListener: data available ");
}
@Override
public void onAllDataRead() throws IOException {
System.out.println("AsyncReadListener: All data read.. ");
}
@Override
public void onError(Throwable t) {
System.out.println("AsyncReadListener onError() " + t);
t.printStackTrace();
ac.complete();
}
}
22. Code Samples – Non-Blocking I/O
21
final ServletOutputStream os = response.getOutputStream();
// Start NIO Mode!! May only be called once…
// Can not use regular servlet input stream read/write after this
os.setWriteListener(new AsyncWriteListener(...));
public class AsyncWriteListener implements WriteListener {
@Override
public void onWritePossible() throws IOException {
System.out.println("AsyncWriteListener: onWritePossible.. ");
// At some point, you know you’re all done..
ac.complete();
}
@Override
public void onError(Throwable t) {
System.out.println("AsyncWriteListener onError() " + t);
t.printStackTrace();
ac.complete();
}
}
24. Server Endpoint: Annotated
• Simple POJO with @ServerEndpoint annotation
• value is the URI relative to your app’s context root,
e.g. ws://localhost/myapp/SimpleAnnotated
• Annotations for notifications: lifecycle and messages
23
@ServerEndpoint(value = "/SimpleAnnotated")
public class SimpleEndpoint {
@OnOpen
public void onOpen(Session session, EndpointConfig ec) {
}
@OnClose
public void onClose(Session session, CloseReason reason) {
}
@OnMessage
public void receiveMessage(String message, Session session) {
}
@OnError
public void onError(Throwable t) {
}
}
25. Server Endpoint: Programmatic
• Class extends Endpoint
• Callback methods for lifecycle event notifications
• Message notifications require a MessageHandler
24
public class ExtendedEndpoint extends Endpoint {
@Override
public void onOpen(Session session, EndpointConfig ec) {
session.addMessageHandler(new MessageHandler.Whole<String>() {
@Override
public void onMessage(String message) {
}
});
}
@Override
public void onClose(Session session, CloseReason reason) {
}
@Override
public void onError(Session session, Throwable t) {
}
}
26. • @OnMessage method is called when a message is received
• If message is ‘stop’: close the session
• Otherwise, echo the message along with a hit count
• Broadcast – iterate over open sessions
int count = 0;
@OnMessage
public void receiveMessage(String message, Session session) throws IOException {
if ( "stop".equals(message) ) {
session.close();
} else {
int id = count++;
for (Session s : session.getOpenSessions() ) {
s.getBasicRemote().sendText("Echo " + id + ": " + message);
}
}
}
Simple echo + server provided data (using annotations)
25
27. @OnMessage
public void receiveMessage(final String message, final Session session)
throws IOException {
if ( "stop".equals(message) ) {
session.close();
} else {
System.out.println(message + ", " + executor);
final int id = count++;
broadcast(session, "Echo " + id + ": " + message);
executor.submit(new Runnable() {
@Override
public void run() {
try {
Thread.sleep(500);
} catch (InterruptedException e) {
}
broadcast(session, "Delayed " + id + ": " + message);
System.out.println("executor -- send " + message);
}
});
}
}
Simple echo + delay…
26
29. Notices and Disclaimers (con’t)
Information concerning non-IBM products was obtained from the suppliers of those products, their published
announcements or other publicly available sources. IBM has not tested those products in connection with this
publication and cannot confirm the accuracy of performance, compatibility or any other claims related to non-IBM
products. Questions on the capabilities of non-IBM products should be addressed to the suppliers of those products.
IBM does not warrant the quality of any third-party products, or the ability of any such third-party products to
interoperate with IBM’s products. IBM EXPRESSLY DISCLAIMS ALL WARRANTIES, EXPRESSED OR IMPLIED,
INCLUDING BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A
PARTICULAR PURPOSE.
The provision of the information contained herein is not intended to, and does not, grant any right or license under any
IBM patents, copyrights, trademarks or other intellectual property right.
• IBM, the IBM logo, ibm.com, Bluemix, Blueworks Live, CICS, Clearcase, DOORS®, Enterprise Document
Management System™, Global Business Services ®, Global Technology Services ®, Information on Demand,
ILOG, Maximo®, MQIntegrator®, MQSeries®, Netcool®, OMEGAMON, OpenPower, PureAnalytics™,
PureApplication®, pureCluster™, PureCoverage®, PureData®, PureExperience®, PureFlex®, pureQuery®,
pureScale®, PureSystems®, QRadar®, Rational®, Rhapsody®, SoDA, SPSS, StoredIQ, Tivoli®, Trusteer®,
urban{code}®, Watson, WebSphere®, Worklight®, X-Force® and System z® Z/OS, are trademarks of
International Business Machines Corporation, registered in many jurisdictions worldwide. Other product and
service names might be trademarks of IBM or other companies. A current list of IBM trademarks is available on
the Web at "Copyright and trademark information" at: www.ibm.com/legal/copytrade.shtml.
30. Thank You
Your Feedback is
Important!
Access the InterConnect 2015
Conference CONNECT Attendee
Portal to complete your session
surveys from your smartphone,
laptop or conference kiosk.
Editor's Notes
The “modern web application” has several possible front-ends:
Rich-client applications written for use on the desktop (still around!)
Single Page Applications enabled by Javascript frameworks like Angular, Backbone, Knockout, Meteor, etc.,
Native applications for smartphones and tablets,
and Hybrid applications which bridge the two (often native stubs for HTML5 SPA)
All of these possible front-end clients make REST over HTTP requests to the common backend…
CRUD operations
Reasonable approach for most resource (CRUD)-oriented applications
Of course, the backend is where the interesting stuff (at least with respect to this session) happens.
If you are submitting the async work via an executor, you can set a timeout, and optionally register a timeout handler.
If a handler isn’t present, a ServiceUnavailableException will be thrown with status code 503.
The TimeoutHandler is given the AsyncResponse as a parameter, which must still be resumed to send a response back to the client.
The AsyncResponse can also be cancelled, with an accompanying indication of how long a client should wait before retrying. A cancelled AsyncResponse sends a 503 / Service Unvaliable response to the client.
If you are submitting the async work via an executor, you can set a timeout, and optionally register a timeout handler.
If a handler isn’t present, a ServiceUnavailableException will be thrown with status code 503.
The TimeoutHandler is given the AsyncResponse as a parameter, which must still be resumed to send a response back to the client.
Unmanaged threads and timers can cause problems for containers: they inhibit an app server’s ability to track and manage resources.
Concurrency Utilities provided in EE7 extend the mechanisms java.util.concurrent to provide a familiar API to applications that allows easy creation of container-managed resources to support async activities.
Java EE Concurrency utilities provide context propagation, so that new threads inherit the container thread context of the originating application component thread (which is important for referencing other EE).
By default, a new instance of server endpoint is instantiated for each client connection (section 3.1.7 of JSR 356 specification).
In other words, by default, WebSocket is "Single Thread Model".
The API includes a MessageHandler for Whole and Partial messages
Each web socket session uses no more than one thread at a time to call its MessageHandlers.
This means that, provided each message handler instance is used to handle messages for one web socket session, at most one thread at a time can be calling any of its methods.
A single handler can be shared between sessions: it would then have to deal with concurrency
@OnMessage methods are single threaded for an endpoint…
Note the broadcast! Easy as pie to send the same data around to different sessions.
Also note that each connection will have it’s own Endpoint instance, but that instances can see each other through sessions: Endpoints are not thread safe, but Sessions are.
@OnMessage methods are single threaded for an endpoint…
Note the broadcast! Easy as pie to send the same data around to different sessions.
Also note that each connection will have it’s own Endpoint instance, but that instances can see each other through sessions: Endpoints are not thread safe, but Sessions are.