Spring Microservices In Action Second Edition Pdf Github

0 views
Skip to first unread message

Olivie Inoue

unread,
Aug 5, 2024, 5:53:28 AM8/5/24
to ledasomwha
AzureSpring Apps is the new name for the Azure Spring Cloud service. Although the service has a new name, you'll see the old name in some places for a while as we work to update assets such as screenshots, videos, and diagrams.

GitHub Actions support an automated software development lifecycle workflow. With GitHub Actions for Azure Spring Apps you can create workflows in your repository to build, test, package, release, and deploy to Azure.


This example uses the steeltoe sample on GitHub. Fork the repository, open the GitHub repository page for the fork, and select the Settings tab. Open the Secrets menu, and select New secret:


The command az spring app create is currently not idempotent. After you run it once, you get an error if you run the same command again. We recommend this workflow on existing Azure Spring Apps apps and instances.


The package search pattern should only return exactly one package. If the build task produces multiple JAR packages such as sources.jar and javadoc.jar, you need to refine the search pattern so that it only matches the application binary artifact.


The following example deploys to the default production deployment in Azure Spring Apps using source code in the Enterprise plan. You can specify which builder to use for deploy actions using the builder option.


The following examples deploy to an existing staging deployment. This deployment doesn't receive production traffic until it's set as a production deployment. You can set use-staging-deployment true to find the staging deployment automatically or just allocate specific deployment-name. We only focus on the spring-apps-deploy action and leave out the preparatory jobs in the rest of the article.


The Delete Staging Deployment action allows you to delete the deployment not receiving production traffic. This deletion frees up resources used by that deployment and makes room for a new staging deployment:


Another option is to use the Maven Plugin for deploying the Jar and updating App settings. The command mvn azure-spring-apps:deploy is idempotent and automatically creates Apps if needed. You don't need to create corresponding apps in advance.


GitHub Actions should be enabled automatically after you push .github/workflow/main.yml to GitHub. The action is triggered when you push a new commit. If you create this file in the browser, your action should have already run.


If your action runs in error, for example, if you haven't set the Azure credential, you can rerun checks after fixing the error. On the GitHub repository page, select Actions, select the specific workflow task, and then select the Rerun checks button to rerun checks:


The user-name and os-name variables come from Java system properties and are automatically registered with the template engine.The now variable is the value of new java.util.Date() when the command was run.


As a more realistic example to create Java code, the following three listings show the contents of the action file named Controller.java and its related action and templated Java files in the repository github.com/rd-1-2022/udc-spring-controller.The feature variable is a command option.


I'm starting the process of converting some Java-based LTI tools (Java is used for LTI validations, and also for proxying the Canvas API, although not on the client side) to the LTI 1.3 standard. If you are using Java in your development, what LTI 1.3 libraries are you currently using, or would you recommend? In addition, if you could point to examples of use of such libraries which do not require a Spring Boot application, that would be very helpful. I haven't seen much publicly available (I am aware of the libraries created at the UOC, although I found no examples of use for a regular web app -only one example is public, and is for a Spring Boot application-). Thanks!


I apologize if this is a repeat (I'm pretty sure I posted a reply earlier but somehow it did not get recorded!). Thanks Matthew for your reply (BTW, I enjoyed watching your LTI presentation at CanvasCon Online). Since my apps do not use Spring though, I was hoping somebody would have either done something for this type of (plain) Java app, or at least show an example of how their libraries can be used from such application (which is why I specifically asked for a non-Spring Boot type application example, although I appreciate your response in any case!). Could any of the libraries you've worked on be used without Spring?


The Spring Security OAuth2 code (which the LTI 1.3 code uses), builds on the libraries from Connected2ID ( -jose-jwt), however writing a full LTI 1.3 implementation is a reasonable piece of work as LTI 1.3 is more complex than LTI 1.1


Thanks again for replying. And sorry for having confused you with a presenter at Canvas Con!. Yes, I agree that it's likely considerable work to start from scratch building an LTI 1.3 java app - although I'm pretty familiar with Java itself and have built many such non-Spring apps, but they were all using basic (open source) LTI libraries , so I'm going to have to decide whether to do all that work myself, or look for some other alternative which would also requite quite a bit of work too (e.g. converting my apps to use Spring Boot so I could use your libraries -or those from UOC-, etc.). Unless somebody else comes up with what I need before I start building it myself, of course, which would be the ideal :-). Thanks again for your input!


@matthew_buckett, Was looking at your library, but it seems more targeted for the Tool's side of the implementation. Do you know any Java libraries from the Platform's perspective? Right now I just need to do a POC for LTI 1.3 launch.


Sorry, I don't know any libraries out there for supporting the provider side of the launch, there is the Spring Security Authorization Server however I don't know how much more you'd need to add to support the LTI 1.3 launch. It is currently under heavy development and is probably a reasonable library to do any development against.


Hi Everyone! I just thought I'd say hello on this thread because I, too, am a java developer with existing tools (on LTI 1.1) and am seeking to update to LTI 1.3. (Our institution is in the process of moving to Canvas, and I'm updating my tools at the same time.).


As a first step, just to help with my learning, I used the IMS Global's LTI 1.3 Reference Implementation to create a "dummy platform" and "dummy tool" and got them talking to each other successfully. (confession, that took me the better part of a day because I had to slow down and get acquainted with all the configuration options!). I also highly recommend this video. I watched it twice!! =qHStELNsYyI


As a second step, I'm very grateful for the library above. Thank you Matt! I downloaded it from github and got it running. I don't usually use Spring Boot either, but, the whole LTI 1.3 process is more complicated than my whole LTI app, so, it's easier for me to rewrite my app from scratch based on a working LTI template than it is for me to start over with LTI in my existing app's structure.


So, building off my experience above, my goal is to get the "dummy platform" talking instead to the spring-security-lti-demo. I don't quite have it working because the IMS reference implementation is giving me an unhelpful Rails error. So, I'm watching lots of nerdy technical talks to teach me about Oauth2 and I'm combing through the http parameters at each step of the launch flow.


For me, it's failing on the authorization request step, where it's trying to go back to OIDC Auth URL ( -ri.imsglobal.org/platforms/xxxx/authorizations/new). It's an HTTP 500 Internal Server Error on the IMS Reference implementation side (the "dummy platform"). I'm quadruple checking the public and private keys, etc, but have not yet figured it out.


Thanks for your post @iosparkletree1 ! Sure, it'd be nice to share experiences as we pursue our respective LTI 1.3 conversions! My disadvantage with respect to IMS resources is that I only have access to their public docs (and, I believe, there's public access to their reference implementation but not to all of their tools, for example, which is unfortunate). I might start with a real platform instead of coming up with a 'dummy' one (since I could test a tool against the Canvas platform; which could be quicker ). In any case, I'll take a look at what IMS offers just in case. BTW, thanks for pointing out to the You Tube webinars from the IMS. I had not watched that one yet, and I also found it pretty useful, as you commented.


I am quite stuck in my attempts to connect the IMS LTI 1.3 Reference Implementation "dummy platform" with spring-security-lti-demo. So, I next tried to connect to different java library, Unicon's: Even though I got this up and running too, unfortunately I'm again sstuck with a Rails error on the reference implementation site at the authorization request step.


A disadvantage that I have is that I'm a developer, not an admin, so I don't have permission to adjust any of our institution's developer keys. I have to submit tickets to a colleague to set it up for me, which makes it difficult to explore with trial and error. But, on the plus side, we learn together!


Whilst it is not quite complete, I believe it is working, so anyone in need of a testing platform for LTI 1.3 may like to try out the updated version of saLTIre at and/or I hope to complete the update within the next week.


Here's the latest from me. As I mentioned, I tried a couple examples (spring-security-lti-demo and tool13demo) but couldn't get either to work against the IMS Reference Implementation (lti-ri). I am really perplexed because they should work. I even emailed the IMS Global info address to ask if you have to be a paying member to be able to use the lti-ri. They responded that I should be able to use it for Deep Linking, Assignment and Grades and Names & Roles.


To do that, I had to deploy to our test server, because the Canvas test server wouldn't be able to communicate with my development machine, which is on a hidden part of our network. So, I tried to deploy spring-security-lti-demo to a test server but discovered that Spring boot 2 requires Tomcat 8. Unfortunately, my institution has not yet upgraded and are still on Tomcat 7. So, I can't use spring-security-lti-demo. Tomorrow, I'll try tool13demo.

3a8082e126
Reply all
Reply to author
Forward
0 new messages