 All right, I'm Jeremy Davis. I'm a Senior Solution Architect at Red Hat. I've been here for about six years or so. I work with our customers to make them awesome using JBoss software. So today we're gonna talk about seven Java EE7 things you can do with JBoss EAP7. The number seven figures prominently in that title, it's because I thought it was catchy, someone else at the conference is doing 50 Java EE7 things in, but they're doing that in 90 minutes. You're gonna get seven things in 25 minutes. So I think it's roughly equivalent if you get a number of things you can do per minute. I'm also gonna cover one not Java EE7 thing. First and foremost, joindevelopers.redhat.com if you are not already a member. It's a fantastic site, it's absolutely free to join. It is just resources that can help make you awesome as a programmer. There's a lot of content on here. There are books you can download as PDFs anyway. All kinds of articles, blog posts, a lot of great resources. It costs absolutely nothing as well. So if you're not a member, go to developers.redhat.com, sign up. You can also sign up by scanning here inside the booth as well. All right, so seven Java EE7 things you can do with JBoss EAP7. I don't know how many people are using Java EE7 today. A lot of great stuff in version seven. I thought I would start off with kind of one of the big ticket things, the batch program. Let's just jump over really quickly and take a look at what batch processing looks like. This is an application. It's part of the JBoss Quick Starts. I'll jump into that in just a moment. What we're gonna do here is we're gonna pick a temp text. We're gonna generate a text file. We'll call it a new file and we'll put a thousand records in it. We'll generate that file. Maybe we'll just do a hundred records there. And the demo off to a roaring start. Let's do a hundred records. There we go, generate our new file. Now we'll start our import job. We see our job is down here running a batch process. We can update this and we've completed our batch job. This is one of the JBoss examples. It shows you how you build out batch applications. And then we'll look at some graphical ways coming up here. This is the UI for building out batch applications. That's just a quick taste. We'll jump into that in a little more detail. Where you can get these examples that I'm gonna show. So I've got a bunch of other code in here. One, you can download them from the Red Hat Customer Support Portal. If you have a login to our Customer Support Portal, the JBoss EAP7 Quick Starts are available right where you download the binaries and the source code. And we are an open source company. We have no proprietary software. All the source code for all our products is completely available and download the source code. It will save you tons of time. At some point you'll be debugging and you'll want to step debug right into that source code. It's gonna save you a lot of time. Grab your source code. All these examples are also available on GitHub. If you go to JBoss Developer, which is the official code repository for the developer's website, JBoss-EAP-Quick Starts. You can clone this repository and pull all these applications right into Eclipse or IntelliJ or whatever IDE you like using. Some of the other examples is the Java EE7 samples. These are not JBoss specific. There are actually, I think, builds that will run with WildFly, that will run with WebLogic, WebSphere. Glassfish, so you can pull in samples for virtually any application server off of this site. All right, so one not Java EE7 thing before we jump into more Java EE7 things is Arcillion. So Arcillion's related to Java EE. What it does, it does in-container testing. And this is one on award here at Java a couple years back when it first came out. It's seen several talks by the guys that wrote this and who steer the project, have presented this week. What Arcillion does, if you have not used it, is it either spins up an embedded application server or builds a mini version of your application and pushes it out to an application server so that you can do actual end-to-end testing, right? So you don't have to mock stuff out. You don't have any kind of stubs, right? You can actually test your application using injection, using all the parts of the application server. And these guys right there are the leads for the project, although you can't see them on the camera. So let's jump over really quickly. It's super fast as well. So you give up nothing in terms of performance. It's based on JUnit, right? So we've got a JUnit test right here. And all we have to do is decorate it with an at run with Arcillion class. And if you can see that, whoa. That's a little big there. You just annotate your class with run with Arcillion. And then when you run it, you can just right click and run as JUnit test. And what this is doing is it's making a very small version. We have a deployment right here that builds a very small version of your application, pushes it to my application server, which I've got running here, started inside of Eclipse, and we pass our JUnit test, right? So we did three complete tests, built an application, pushed it into the app server, did three complete end-to-end tests in a couple of seconds. If you're not using Arcillion today, go out, grab Arcillion. The website has a great getting started guide that'll save you a ton of time. And it is related to Java EE7, right? It's not an official spec kind of thing, but it's certainly related to it. And a lot of these examples are based on. So the Java EE7 sample site has Arcillion tests for all of those samples. And there's the website right there. We have a book on testing microservices coming out. I think you may have seen a presentation earlier this week on how to do that. All right, so batch, we started off with batch. This was one of the big ticket items in Java EE7, based on JSR 352 for those of you who keep score for JSRs. One of the nice things about having XMLs, we can do graphical representations, right? I'm gonna give you a really, really quick overview. You can break your application up, you can make decisions, you can do transitions, you can wire all this together inside of your XML, right? You have a job repository as an operator that then moves the job from step to step, right? And we have then different classes, item reader, processor, and writer that then handle the batch job. And so this was the batch job we ran a second ago. And what we do here is we just generate a new file here. Let's put like 200 items in this thing. And we'll call it new file. So we generated a new file with 200 records. Let's start our import batch jobs, we start our job there and our job's finished. If we go over here and look inside of our XML, let's zoom in here again. We've got listeners to see when we have changes, then we break these up into chunks. We have chunks and batchlets or a couple of the concepts of how you actually break your batch application up into pieces. We've got a reader and a writer, we do some formatting. We can attach listeners so you can listen to events that happen during the job, and then we get to the end here. Under the covers, it's all XML. It's pretty readable and pretty simple and easy to do. And we have IDs for the steps that we're taking. But you can do decisions in here so you can put some conditional logic inside of your batches. If you use things like Spring Batch, it was heavily influenced by Spring Batch. This is one of the nice new features in E7. This batch jobs are incredibly common, right? We do these all the time in the enterprise. Like so next topic, JSON processing. So this is what JSON looks like. These are some of the speakers we've been talking here this week. And we now have an API for both creating and consuming JSON. There's a couple of different ways we can create JSON. JSON Generator is one of them. If you look here, it's a pretty simple API. We're going to just programmatically create this object, we have to pass on a writer. And then we can spit out JSON. We can also do with an object builder, right? There's a little bit different API here. We use add and then we can put arrays inside of there. And then there is a JSON parser that allows you to pull in JSON and then parse that for use inside of your application. Yeah. And we've got our JSON controller example in here. And we'll jump over a little. Yeah. Yeah, can I talk about that after the talk? Absolutely. All right, so this is an example of JSON parser. These examples, by the way, all come from JBoss examples, the JBoss examples. Well, you'll be able to pull all this stuff in, run these examples on your own, give you a good quick start with the technologies. All right, WebSockets are another feature. This was new, HTML5, right? Well, WebSockets are important because they allow us to have duplex communication between our browser and our server, right? So for instance, a chat application is a great example of that. The way you do this, we can simply decorate an endpoint and this becomes a WebSocket endpoint, which we can then connect to with a WS protocol from a client. We can also programmatically create one, right? And so we can pass in the configurations and create that. We also have clients, right? So we can do annotated clients or programmatic clients. And then we can, we have encoders and decoders that allow you to marshal back and forth to JSON that's going to be coming over the wire in this connection. It's an example of how you would do that. And there's an example of decoder, right? A little quick code snippet. So now I'll jump to another example here. This is one of the Jboss examples and this is probably my favorite example because it's a really fun example. And it also has a whole bunch of things in here. It has concurrency, it has batch going on here, it has JMS going on behind the scenes here. But what we're going to do, it's called thread racing. So we insert a coin here and we have threadianopolis, right? And what we're doing, we're talking back and forth through web sockets, right? So the browser here has opened up a connection to my application server and we're sending information back and forth as this job moves along. And we can see the racers all go through the batch API first, spawn new threads here. We're making some Jaxrs web service calls. Jaxrs is coming up here in a second. We're doing some JSON calls and now we have official race results. Now, this is kind of kitchen sink example of a lot of these technologies and it's very fun, but we noticed we didn't refresh this web page at all, right? All that communication happened dynamically, information going back and forth over the wire. This example is not in my ID, if I'm not mistaken. Sorry? Oh, that was web socket race, yeah. Okay, all right. Thank you. There we go, web socket race. This is web socket. We're opening up a web socket session right here, passing our racers. And this is a little bit complicated example. As I mentioned, there's all kinds of stuff inside of here. But you can see in here the batch, there's concurrency where we split the threads up. There's Jaxrs, JSON, a lot of different things in that example. I'm making anybody dizzy by jumping back and forth between my desktops. All right, so serverless. So serverless is one of the oldest Java EE technologies, right, great technology. Server 3.1 had some small features and then a couple of kind of major features, asynchronous being the biggest feature that was added to serverless in version 3.1. What this shows here is an async context. And what we can do is we can start a long running service. Our service is going to take some time and then we'll execute in another thread. So we can go ahead and return and we don't have to wait, right? For that to happen. Under the covers, we can do a non-blocking IO here, so which makes it a lot faster. It also means we can scale up a lot more. Undertow, which is the servlet engine in JBoss EAP 7, replaces our long running use of Tomcat. It's extremely performant, much faster, much smaller than Tomcat and can scales up tremendously well. Give you an example of what that looks like. Got an asynchronous servlet here. And we're just calling this method of this object long running service, which for the example purposes, this thing is just going to sleep for a while, right? To give you an example of how you can run this, let's take our servlet async. So we're here, let's make a request here. So it's sleeping for five seconds, right? We're going to hit that, it's going to sleep for five seconds, then we get a response back, right? We can see that running. But it'll allow you to scale your applications when you're going to call out to a third-party service that might take more time than you'd want to make somebody wait on. All right, so Jaxrs2.0 was part of Java EE7 and it's all about REST, right? Because we all like doing REST more than we like doing SOAP. It's not like we're doing REST more than SOAP, I think most people do. Biggest thing that comes out in 2.0 is a client API. It's a really nice client API here. It has a web target that represents a URI, and you can call into the client API. You can also marshal directly from that API. Well, as long as we don't have an error here, right? So we can call URI and we can immediately turn that back into an object. So we set our query param here. When we get that, we get our class right out of that object. We can also do this asynchronously, right? So we can do asynchronous calls. You get a future back, right? Part of the futures API. It's been in since five. You can also add filters in. So if you want to do cross-cutting concerns, like logging, you can decorate, you can add filters, look at the request headers, right? And then use a cache or apply security, number of different things you can do. And you can do that on server side or client side, whether the request is going in or going out, right? It's an example of how you would create your own filter and then you can annotate your methods. So you can decorate the method call and apply the filter in that way. All right, so JMS 2.0. JMS 2.0 doesn't offer anything revolutionary. What was really built around was ease of use. So making JMS a lot easier to use. If you've written JMS code before, this is a lot simpler to write, right? We don't have to do the, we don't have to connect connections and sessions. There used to be a lot of kind of boilerplate code that you wrote with JMS. A lot of boilerplate in a lot of the original Java EE APIs. All we have to do is get a JMS context, right? And we create a producer and we send something. So it's pretty simple, pretty compact. Same thing for a consumer, right? We can just grab a consumer and we receive our message. We can also have, whoops, concurrency. So our next feature, so concurrency. And we already looked at the thread executor example, but it shows you how we can do the concurrent utilities. So you have this in Java SE. This has always been a bit of a tougher, using threads has been tougher inside the EE world because the container wants to manage all that for you, right? Because the container is going to apply multiple different things at that thread level. But this way we can, we have an executor service and a scheduled executor. So we can either execute something immediately or we can give it, we can give it programmatically, tell it when we want it to execute. And the way this looks up is the container will provide this for you. So you get this from the container. You can inject it, right? Or you just can grab it out of J and DI and then you submit a runnable to it, right? On the schedule one, you just give it in a schedule of when you want it to run this. And that gets us through in about 20 minutes. Actually I had a couple of minutes to spare. So seven things in under 25 minutes. All right, so thanks. And remember, join developers.redhat.com. All right, thanks.