Vous êtes sur la page 1sur 4

« Mise à jour de JsonObjects... | Principal | System.Logger--le...

» Nombre de publications : 2401


Nombre de commentaires : 6163
Visites

Java EE 8 : envoi d'événements CDI 2.0 asynchrones d'hier : 22225 Visites
d'aujourd'hui : 12782 Lectures de
messages
avec ManagedExecutorService / heure : 913
Meilleures publications :
1. Adam Bien
4731453
2. Résultats de recherche pour '' :
Java EE 8 avec CDI 2.0 a introduit les événements CDI asynchrones . L' Weblog d'Adam Bien
1383974
Eventinterface a été étendue avec la fireAsyncméthode et un 3. Blog d'Adam Bien
502911
NotificationOptionsparamètre facultatif. 4. Mozilla Firefox 1.5.0 est le
navigateur le plus utilisé - du moins
sur mon blog : Adam[...]
142287
Vous pouvez désormais envoyer des événements de manière asynchrone, en 5. Installer Oracle JDBC-Driver sur
Wildfly / JBoss : Weblog d'Adam
utilisant également l' instance ManagedExecutorService injectée : Bien
106904
6. Java 8 : Lire un fichier dans une
chaîne : Weblog d'Adam Bien

103873
7. 301 Déménagé Définitivement
import java.time.LocalTime;
72624
8. Exemple de FlatMap Java 8 :
import java.util.concurrent.CompletionStage;
Weblog d'Adam Bien
66888
import javax.annotation.Resource;
Tendance (dernière heure) :
1. Retour aux fondamentaux : Hello
import javax.ejb.Schedule;
Remote Method Invocation (RMI) :
Weblog d'Adam Bien
import javax.ejb.Singleton;
2
2. Si Gmail ne fonctionne pas après la
import javax.ejb.Startup;
mise à jour de macOS (Mojave /
Catalina) : Adam Bien[...]
1
import javax.enterprise.concurrent.ManagedExecutorService;
3. Session JDD JavaEE : l'avenir, c'est
maintenant, mais il n'est pas encore
import javax.enterprise.event.Event;
uniformément réparti : Adam[...]
1
import javax.enterprise.event.NotificationOptions;
4. Importance de Java EE, JCP, Java
EE Guardians et Microprofile--
import javax.inject.Inject;
Interview W[...]
1

5. Glassfish pourrait devenir le killer


appserver pour Java EE 5... : Adam
@Startup
Bien's [...]
1
@Singleton

archives du blog about.adam-bien.com


public class EventSource {

@Inject

Event<String> fireAlarm;


AT E L I E R S E N L I G N E
@Resource

ManagedExecutorService threadPool;

@Schedule(second = "*/5", minute = "*", hour = "*")

public void send() {

String event = "fire " + System.currentTimeMillis();

CompletionStage<String> completion = this.fireAlarm.

fireAsync(event, NotificationOptions.ofExecutor(threadPool)); // returns immedia


completion.thenAccept(this::eventDelivered);

void eventDelivered(String event) {

//...receipt after delivery

Les événements asynchrones sont reçus avec l' annotation @ObservesAsync :

import java.time.LocalTime;

import javax.enterprise.event.ObservesAsync;

public class EventSink {

public void onFireNotification(@ObservesAsync String event) {

//...

Rendez-vous à Java EE 8 sur Java 9, à l'aéroport de Munich, Terminal 2

Publié à11:14 31 octobre 2017par Adam Bien ,


Commentaires[0]  | Vues/Accès : 13469

ateliers virtuels en direct : la NOUVELLE persistance sans serveur pour Java sans serveur sur
AWS, le 15 décembre 2022, est ouverte aux inscriptions . Également via : meetup.com/airhacks et
airhacks.eventbrite.com

airhacks.fm le podcast :

Restez en contact : airhacks.news .

C O M M E N TA I R E S :

P O S T E U N C O M M E N TA I R E :

Nom: E-mail:

URL : Avertissez-moi par email des nouveaux



commentaires
...LES 150 DERNIERS MESSAGES

CDI Event Arrival Integration Test with


Quarkus
Votre commentaire: Becoming
an Apache Maven Committer--
airhacks.fm podcast

IaC: Provisioning MicroProfile App on


Quarkus as AWS Lambda Function URL
with Pulumi
GraalVM, Apple
Silicon (M1) and Clouds--
airhacks.fm podcast
Mostly About Serverless
Java--99th
airhacks.tv Q & A Live Stream
Serverless Jakarta EE, MicroProfile,

Quarkus, AWS Lambda, Containers and


serverless SSO--or Topics for 99th
airhacks.tv Q & A live streaming show
Working in the Shadows ...for Quarkus--

airhacks.fm podcast

Convenient List Generation with


java.util.stream.Stream
Convenient List Generation
with
java.util.stream.IntStream

Infrastructure as Code: Provisioning a AWS


S3 Website With Pulumi and Java
Innovation, Clouds, Kubernetes, Standards

and Java--airhacks.fm podcast


From Java/JDK 7+ and Project
Coin over
Project Amber to Better Java Serialisation-
airhacks.fm podcast
Invoking AWS_IAM Auth
Lambda Function
URL with Java 11+ HttpClient
Real World Enterprise Serverless
Java on
AWS Cloud--airhacks.fm podcast
Java 17 String to JSON with Glassfish'

Se souvenir des jakarta.json


AWS Lambda
with Provisioned
informations ?
Concurrency: How to use the latest
deployment with HTTP API Gateway
How Pulumi for Java Happened--airhacks.fm

podcast

AWS Lambda:
Syntaxe HTML :
NON autorisé "UnreservedConcurrentExecution below its
minimum value" and the solution
Serverless Caches, JPA, Quarkus,
JWT,
Veuillez répondre à cette simple question mathématique s'il vous plait SOAP deprecation, JSF performance,
PostgreSQL clusters and JPA--98th
airhacks.tv
4 + 47 = AWS Lambda:
Exposing Java (Corretto) /
MicroProfile HTTP / REST Service via
Function URL without Gateways or
Application Load Balancers with CDK
 Aperçu 
 du message Serverless, Caches, JPA, Quarkus,

Multipart, JSF, Clusters--or Topics for 98th


airhacks.tv live streaming show
Java: Text Blocks + String#formatted
=
JSON

AWS Lambda: Provisioned Concurrency


with Java CDK

Finding Some Sense in a Nonsensical


Technology World--airhacks.fm podcast
Our Favourite Java 9, Java 11, Java 17
and
Java 18 Features--an airhacks.fm podcast
Reducing AWS Lambda Cold Starts with

Application Load Balancer


Deploying a MicroProfile /
Quarkus
Application as AWS Lambda integrated with
Application Load Balancer (ALB / ELB)
Structuring Applications With Or Without

OSGi--an airhacks.fm podcast


Generating Code Coverage Reports
for
System Tests with Quarkus
A Cloud Migration Story: From
J2EE to
Serverless Java--airhacks.fm podcast
Live from 13th WDI in Warsaw: Fast and

Productive: Serverless Java in the Clouds


Mappers, Microservices, Native vs. JVM

Serverless Lambda, Tautological Tests,


Micronaut vs. Quarkus , Reactive, Loom-
-97th airhacks.tv

Mappers, Microservices, Native vs. JVM,


Serverless AWS Lambda, Tautological Tests,
Micronaut, Quarkus, Reactive Programming,
Loom-or Topics for 97th airhacks.tv live
streaming show

Piranha.cloud: Headless Applets Loaded


with Maven--an airhacks.fm podcast
Writing Metrics from AWS Lambda /

Quarkus / MicroProfile with Lambda


Powertools Java to Amazon CloudWatch
Combining Java's System.Logger with
Quarkus' JSON logging on AWS Lambda
The JavaSpecialist(s)--an airhacks.fm
podcast
Dr. Deprecator--an airhacks.fm podcast
Java User Group (JUG) Stockholm: "Java
EE Was Serverless--Now Comes Cloudy
Quarkus"
Java Authentication and Authorization with
Apache Shiro--an airhacks.fm podcast
Early 2022: Upcoming JUGs, Keynotes and
Workshops
Quarkus Renarde, Devmode, DDoS, Bean
Validation, Serverless Java, Anemic Domain
Model--96th airhacks.tv
Live from Portugal: A productive no-
framework approach with plain Web
Components
Testing 404 Responses With Rest Client for
MicroProfile
Quarkus Renarde, Bean Validation and DI,
CDI Events, DDoS Prevention, AWS
Lambda Clarifications--or Topics for 96th
airhacks.tv live streaming show
Trombones, Java, Large Scale WebSphere
Liberty Deployments and 50.000 JVMs in
Production--an airhacks.fm podcast
Visual Studio Code / Java: How To Create a
Unit Test in a Corresponding Package
System.logger, JDK Enhancement
Proposals (JEP) and knowing about Java's
future--an airhacks.fm podcast
Java / JSON-B: String To JsonObject
Java, Java EE, Jakarta EE, MicroProfile,
Clouds and Duke Adventures in Guatemala-
-an airhacks.fm podcast
Installing Java 17 / Amazon Corretto 17 on
AWS Codebuild for Apache Maven Builds
Kumuluz API Gateway, MicroProfile and
Serverless Functions--an airhacks.fm
podcast
Debezium, GlassFish vs. Payara and
Piranha Cloud, CDI Events, NoSQL vs.
SQL, Kafka and WebAssembly--95th
airhacks.tv
MicroProfile on Quarkus on AWS Lambda
on Java / JVM (Amazon Corretto): ARM vs.
Intel
AWS Lambda Powertools Java--an
airhacks.fm podcast
Debezium, GlassFish vs. Payara, CDI
Events, NoSQL vs. SQL and Transactions,
WebAssembly--or Topics for the 95th
airhacks.tv live streaming show
Hybrid MicroProfile Deployments with
Quarkus: Severless with AWS Lambda and
Standalone Thin JARs
AWS Lambda: The Impact of Reflection and
Annotations on AWS Lambda's Performance
Pragmatic Modularity and OSGi--an
airhacks.fm podcast
JSON-B: How to Serialize a Formatted
LocalDateTime into JSON--and Back
JDK 1.0+: ASCII Progress Indicator
Kafka Connect CLI, JFR Unit, OSS
Archetypes and JPMS--an airhacks.fm
podcast
kcctl--The Missing Kafka Connect Command
Line Interface (CLI)
Regular Expressions With Java's Text
Blocks / Multiline Strings
MicroProfile 5.0--an airhacks.fm podcast
Web Components, Boundary Control Entity
(BCE) and Unidirectional Data Flow with
redux
2021 in review, EDAs, EJB to CDI, JPA,
Logging, DDOS, AWS, Asynchronous
Processing, Obfuscation, MicroProfile and
JDBC--94th airhacks.tv
Formatting String Lists with
Collector#joining, Prefix and Suffix
2021 in review, EDAs, EJB to CDI, JPA,
Logging, DDOS, AWS, Asynchronous
Processing, Obfuscation, MicroProfile and
JDBC--or Topics for the 2022.1 airhacks.tv
Object Mapping Observations and the
Deprecated Dozer
How jClarity Happened--an airhacks.fm
podcast
Creating Executable Java "Scripts" with an
Executable Java "Script"
Quarkus CDK Java Lambda Template
Supports Amazon API Gateway HTTP APIs
Java, Jakarta EE and MicroProfile on Azure-
-an airhacks.fm podcast
Java TextBlocks and String#replace
Live from JakartaONE: Java, Jakarta EE +
MicroProfile = Cloud Native 2.0
Java, OpenSource and the Brazilian
Christmas--an airhacks.fm podcast
From Devoxx Ukraine: Java in the Clouds:
Pointless and Expensive or Productive and
Must-Have?
Deep Learning with Modern Java Code--an
airhacks.fm podcast
Map.of, Unmodifiable and
UnsupportedOperationException
How to negate a filter / the "not"
Serverless Java on AWS--an airhacks.fm
podcast
Live and Interactive JConONE 2021
Keynote: What Would a Startup Do?
Disappearing Youtube Likes, AWS CDK v2
vs. CloudFormation, JAX-RS and Lambda,
Singletons, JPA, ARM, Graviton--93rd
airhacks.tv
AWS CDK, JAX-RS and Lambda,
Singletons, JPA, ARM, Graviton--Topics for
the 93rd airhacks.tv
Deploying MicroProfile on Quarkus as AWS
Lambda with AWS CDK v2 watch and
hotswap
AWS CDK Plain, AWS CDK Lambda Plain
and AWS Quarkus Lambda CDK Plain
Templates are using AWS CDK GA v2 for
Java
GraalVM and Java 17, Truffle, Espresso and
Native Image--an airhacks.fm podcast
Live From Voxxed Days Romania: Java,
Clouds and Cost Driven Architectures
Create a Quarkus / MicroProfile Project
From DevFlix: Hey Enterprise EJB
Developers Now Is The Time To Go
Serverless (and slideless)
JCON: Building Complex Apps with plain
Web Components
Debezium, Server, Engine, UI and the
Outbox--an airhacks.fm podcast
How To Connect to an Insecure SSL
Endpoint with Java HTTP Client
Performance Impression: MicroProfile on
Quarkus as AWS Lambda Fat Function
AI with Java as a Hobby--an airhacks.fm
podcast
Reading A JSON Configuration with JSON-B
(Jakarta EE / MicroProfile) into a POJO
Deploying Quarkus / MicroProfile App as
AWS Lambda with Java CDK
What are AtomicJar and Testcontainers
Cloud?--an airhacks.fm podcast
"The World of Java" with Porto Tech Hub

...THE LAST 10 COMMENTS

Aldo Lushkja wrote:

Thanks Adam to you reply on 88th Airhacks


TV to this question, migrating to Quarkus 2+
version solved the issue.

[...]
Only this little change was

Aldo Lushkja wrote:

Hi Adam,

i've tried what you have done in your video,


but no test was executed.

I've download the mocked project and


launch the[...]

Ananth Raghuraman wrote:

I am a fan of your blog!

Is Netbeans even used anymore (outside of


Oracle or their non-IT customers)?

I know several people are [...]

Kevin Farnham wrote:

Amazingly, strings are a problem throughout


so many languages, C, C++, Java, Python...
How could something so simple as a bunch
of characters repr[...]

David Kant wrote:

Thanks for this really useful post. The


activemq-cli is a great tool for testing JMX
on the local server.

J'ai pu obtenir le rmohr/act[...]

Arend v. Reinersdorff a écrit :

Une option sans coder en dur


src/test/resources :

essayez (InputStream inputStream =


ReadResourceTest.class.getResourceAsStrea

Christian Stein a écrit :

"Il est recommandé d'obtenir un chemin via


les méthodes Path.of au lieu de via les
méthodes get définies dans cette classe car
cette classe peut être obsolète[...]

Simplifier a écrit :

Trop de lignes de code pour une chose


aussi simple.

a écrit:

Je pense que `Path.of` est préféré à


`Paths.get`

Paou a écrit:

pouvez-vous donner un exemple de la façon


de tester en cliquant sur un bouton radio et
en cliquant également sur le bouton d'envoi
du formulaire ?

LICENCE

Ce travail est sous



licence Creative
Commons Attribution-NonCommercial-
NoDerivs 2.0 .

Vous aimerez peut-être aussi