标签

 spring 

相关的文章:

本列表页提供了关于Spring Boot中事务、缓存、JWT和Spring Security集成的教程,包括示例代码和详细说明。

Spring

Spring -

相关推荐 去reddit讨论
Spring

Spring -

This Week in Spring - Tuesday, April 23rd, 2024

Hi, Spring fans! Welcome to another installment of This Week in Spring! We've had a really busy, wonderful week, as always, so let's dive right into it! We want you! ...to submit a talk to SpringOne 2024, in sunny Las Vegas! Hurry, the CFP closes May 3rd! Spring Shell 3.1.11, 3.2.4, and 3.3.0-m1 are now available Spring Modulith 1.2 RC1 has been released I love this post by prolific Spring AI contributor Christian Tzolov: Spring AI: Multimodality - Orbis Sensualium Pictus Spring Boot 3.3.0-RC1 is available now. That's right, RC1! Spring Boot 3.3 will soon be upon us! Now's the time to kick the tires, try the bits, etc. Remember, when Spring Boot 3.3 lands in May, Spring Boot 3.1 will no longer be supported as an open source effort! So now is the time to make sure you've migrated to the latest and greatest! Spring Boot 3.2.5 is available now Spring Security 5.8.12, 6.1.9, and 6.2.4 are available now Spring Security 6.3.0-RC1 is available now Spring Boot 3.1.11 available now In last week's installment of A Bootiful Podcast, I talked to Spring cofounders Dr. Rod Johnson and Juergen Hoeller on the occasion of the 20th anniversary since the 1.0 GA release](https://spring.io/blog/2024/04/18/a-bootiful-podcast-spring-founders-rod-johnson-and-juergen-hoeller-on-the) In last week's installment of Spring Tips, I look at GRPC Spring Authorization Server 1.3.0-RC1, 1.2.4, and 1.1.7 available now Spring for Apache Kafka 3.0.16, 3.1.4, and 3.2.0-RC1 available now Spring for GraphQL 1.3 RC1 released Spring Framework 6.2.0-M1: Overriding Beans in Tests I loved this recap of the recent Google Cloud Next event by Neo4j mad scientist and my friend, and fellow Java Champion, Michael Hunger Here's a nice post over on the Redis blog about how to build a RAG application with Redis and Spring AI The Allegro tech blog has a very nice post on their experience with microservices over the last decade

本周Spring团队工作繁忙,进展顺利。

相关推荐 去reddit讨论
Spring

Spring -

Spring Shell 3.1.11, 3.2.4 and 3.3.0-M1 are now available

On behalf of the team and everyone who has contributed, I'm happy to announce that Spring Shell 3.1.11, 3.2.4 and 3.3.0-M1 has been released and are now available from Maven Central and Milestone Repo respectively. Please see the release notes 3.1.11, release notes 3.2.4 and release notes 3.3.0-M1 for more details. Thanks to all those who have contributed with issue reports and pull requests. How can you help? Project Page | GitHub | Issues | Documentation

Spring Shell 3.1.11, 3.2.4和3.3.0-M1已发布,可供下载。请参阅发布说明获取更多信息。

相关推荐 去reddit讨论
解道jdon.com

解道jdon.com -

Spring Boo中t事务感知缓存示例

缓存是应用程序开发中的一项关键技术,可以提高性能并减轻数据库和其他资源的压力。在 Spring 框架中,利用事务感知缓存可以保障数据一致性,同时最大化缓存优势。让我们深入了解 Spring 事务感知缓存的细微差别。了解事务感知缓存事务感知缓存是软件开发中采用的一项复杂技术,用于增强应用程序内的性能并保持数据一致性。在Spring框架的上下文中,事务感知缓存在优化数据库操作同时确保数据事务的完整性方面发挥着关键作用。事务感知缓存如何工作?在传统的缓存机制中,从数据库或其他资源检索的数据临时存储在内存中,以加快对相同数据的后续请求。然而,在事务感知缓存中,缓存操作与数据库事务同步。它通常是这样工作

Spring Boot中的事务感知缓存是一种关键的优化技术,可以提高性能并保持数据一致性。通过将缓存操作与数据库事务同步,可以减少对数据库的访问,提高应用程序的响应时间。在Spring Boot应用程序中设置事务感知缓存需要配置缓存提供程序、启用缓存支持、定义缓存配置,并使用适当的注释来注释服务方法。通过采用事务感知缓存,可以显著缩短应用程序响应时间、减少数据库负载,并增强可扩展性。总之,事务感知缓存是一个强大的工具,可以在保持数据完整性的同时实现最佳性能。

相关推荐 去reddit讨论
解道jdon.com

解道jdon.com -

Spring Boot 3中将JWT与Spring Security 6集成

在我们的 Spring Boot 应用程序中将 JWT(JSON Web 令牌)与 Spring Security 集成。这将使我们能够通过使用 JWT 整合强大的身份验证和授权机制来增强我们的安全框架。目标:确保只有使用有效的 JWT 令牌才能访问关键端点。在我们的 Spring Boot 项目中,我们主要有两个关键的 REST 端点:一个用于获取所有员工数据,另一个用于添加新员工,这些端点是安全的,并且需要基于 JWT 的身份验证才能进行访问。什么是JWT?JWT(即 JSON Web 令牌)就像数字通行证一样,有助于确保 Web 应用程序的安全。当有人登录应用程序时,服务器会向他们提供

本文介绍了在Spring Boot应用程序中将JWT(JSON Web令牌)与Spring Security集成的方法。JWT是一种安全令牌,用于增强应用程序的身份验证和授权机制。文章详细介绍了JWT的组成部分和生成过程,并解释了为什么选择使用JWT。此外,还介绍了将JWT与Spring Security集成的步骤,包括创建用户类、实现UserDetailsService接口、创建JwtService类和JwtFilter类,并配置SecurityConfig类来设置安全规则。通过将JWT与Spring Security集成,可以实现更安全、更快速和更易于管理的身份验证和授权机制。

相关推荐 去reddit讨论
解道jdon.com

解道jdon.com -

Spring Data JPA中实现更新插入三种方法

在应用程序开发中,执行更新或插入操作(Update-Or-Insert也称为“upsert”)的需求非常常见。此操作涉及将新记录放入数据库表(如果不存在)或更新现有记录(如果存在)。在本教程中,我们将学习使用Spring Data JPA执行更新或插入操作的不同方法。出于演示目的,我们将使用CreditCard实体:@Entity@Table(name="credit_card")public class CreditCard {    @Id    @GeneratedValue(strategy= GenerationType.SEQUENCE, generator = "credit_c

Spring Data JPA提供了三种方法来实现更新或插入操作。第一种方法是使用存储库方法,通过调用save(entity)方法来插入新记录或更新现有记录。第二种方法是使用自定义逻辑,在CreditCardLogic类中编写逻辑来检查记录是否存在,然后决定插入或更新。第三种方法是使用数据库内置功能,如PostgreSQL的"ON CONFLICT DO UPDATE"或MySQL的"ON DUPLICATE KEY",通过编写合并查询来处理插入冲突。

相关推荐 去reddit讨论
解道jdon.com

解道jdon.com -

Spring Feign教程大全

在微服务架构的世界中,服务之间的通信至关重要,开发人员通常依赖强大的工具来促进交互。在这些工具中,Feign 已成为流行的选择,它提供声明式 HTTP 客户端,以便更轻松地使用 RESTful 服务。什么是Feign? Feign 是 Netflix 开发的声明式 Web 服务客户端,旨在简化编写 HTTP 客户端的过程。它允许开发人员直接在 Java 接口中将 HTTP 请求编写为注释,从而抽象出 HTTP 通信的复杂性。Feign 的主要优点:声明式方法:使用Feign,开发人员可以使用注释来定义HTTP客户端接口,这大大减少了样板代码,使代码库更易于维护。负载均衡: Feign与Spri

在微服务架构中,Feign是一种声明式的HTTP客户端工具,用于简化HTTP通信。Spring Cloud Feign是Spring框架的扩展,与Spring生态系统紧密集成,提供了负载均衡和断路器等功能。OpenFeign是一个独立项目,与Spring生态系统耦合度较低,支持声明式API和反应式编程。@EnableFeignClients是一个Spring注解,用于在Spring Boot应用程序中启用Feign客户端支持。Feign客户端可以与HTTP连接池集成,通过动态配置更新Feign URL,并使用@RestControllerAdvice处理异常。此外,可以通过与Micrometer集成来监控Feign客户端的HTTP调用。

相关推荐 去reddit讨论
六虎

六虎 -

13. Spring AOP(一)思想及使用

AOP——也就是面向切面编程,是一种思想。本篇文章描述了该思想的内容以及讲解了连接点、切面、切点、通知的关系,并讲解了如何以xml和注解两种方式使用Spring AOP。

Spring AOP是一种面向切面编程的思维,可以对某一类作业进行集中处理。它可以完成登录验证、日志记录、异常处理等功能。AOP的基本术语包括切面、连接点、切点和告诉。Spring AOP的运用分为增加依靠、连接点办法的编写、界说切面和告诉、界说切点等步骤。可以通过xml装备或注解完成Spring AOP的运用。

相关推荐 去reddit讨论
Spring

Spring -

Spring AI - Multimodality - Orbis Sensualium Pictus

Humans process knowledge, simultaneously across multiple modes of data inputs. The way we learn, our experiences are all multimodal. We don't have just vision, just audio and just text. These foundational principles of learning were articulated by the father of modern education John Amos Comenius, in his work, "Orbis Sensualium Pictus", dating back to 1658. "All things that are naturally connected ought to be taught in combination" Contrary to those principles, in the past, our approach to Machine Learning was often focused on specialised models tailored to process a single modality. For instance, we developed audio models for tasks like text-to-speech or speech-to-text, and computer vision models for tasks such as object detection and classification. However, a new wave of multimodal large language models starts to emerge. Examples include OpenAI's GPT-4 Vision, Google's Vertex AI Gemini Pro Vision, Anthropic's Claude3, and open source offerings LLaVA and balklava are able to accept multiple inputs, including text images, audio and video and generate text responses by integrating these inputs. The multimodal large language model (LLM) features enable the models to process and generate text in conjunction with other modalities such as images, audio, or video. Spring AI - Multimodality Multimodality refers to a model’s ability to simultaneously understand and process information from various sources, including text, images, audio, and other data formats. The Spring AI Message API provides all necessary abstractions to support multimodal LLMs. The Message’s content field is used as primarily text inputs, while the, optional, media field allows adding one or more additional content of different modalities such as images, audio and video. The MimeType specifies the modality type. Depending on the used LLMs the Media's data field can be either encoded raw media content or an URI to the content. Note: The media field is currently applicable only for user input messages, e.g. UserMessage. Example Lets for example take the following picture (multimodal.test.png) as an input and ask the LLM to explain what it sees in the picture. For most multimodal LLMs, the Spring AI code would look something like this: byte[] imageData = new ClassPathResource("/multimodal.test.png").getContentAsByteArray(); var userMessage = new UserMessage( "Explain what do you see in this picture?", // text content List.of(new Media(MimeTypeUtils.IMAGE_PNG, imageData))); // image content ChatResponse response = chatClient.call(new Prompt(List.of(userMessage))); and produce a response like: This is an image of a fruit bowl with a simple design. The bowl is made of metal with curved wire edges that create an open structure, allowing the fruit to be visible from all angles. Inside the bowl, there are two yellow bananas resting on top of what appears to be a red apple. The bananas are slightly overripe, as indicated by the brown spots on their peels. The bowl has a metal ring at the top, likely to serve as a handle for carrying. The bowl is placed on a flat surface with a neutral-colored background that provides a clear view of the fruit inside. Latest (1.0.0-SANPSHOT) version of Spring AI provides multimodal support for the following Chat Clients: Open AI - (GPT-4-Vision model) Ollama - (LLaVa and Baklava models) Vertex AI Gemini - (gemini-pro-vision model) Anthropic Claude 3 AWS Bedrock Anthropic Claude 3 Next steps Next, the Spring AI will rework the Document API to add multimodality support similar to the Message API. Currently the AWS Bedrock Titan EmbeddingClient supports image embeddings. It would be required to integrate additional multimodal Embedding services to allow encoding, storing and searching of multimodal content in the Vector Stores. Conclusion Traditionally, machine learning focused on specialised models for singular modalities. However, with innovations like OpenAI's GPT-4 Vision and Google's Vertex AI Gemini, a new era has dawned. As we embrace this era of multimodal AI, the vision of interconnected learning envisioned by Comenius becomes a reality. Spring AI's Message API facilitates the integration of multimodal LLMs, enabling developers to create innovative solutions. By leveraging these models, applications can comprehend and respond to data in various forms, unlocking new possibilities for AI-driven experiences.

人类以多种方式处理知识,同时跨越多种数据输入模式。机器学习的方法过去通常专注于处理单一模态的模型,但现在出现了一波新的多模态大型语言模型。这些模型能够接受多种输入,包括文本、图像、音频和视频,并通过整合这些输入生成文本响应。Spring AI的多模态能力使其能够同时理解和处理来自各种来源的信息。Spring AI的消息API支持多模态大型语言模型的集成,开发人员可以利用这些模型创建创新的解决方案。

相关推荐 去reddit讨论
Spring

Spring -

Spring Modulith 1.2 RC1 released

I am happy to announce the availability of Spring Modulith 1.2 RC1. Its most important new features are: Dependency upgrades to Spring Boot 3.3 RC1, ArchUnit 1.3, and jMolecules 2023.1.3 Optimized starters to avoid them being included in the packaged JAR Improved reference documentation For more details check out the full change log and the reference documentation. The release of a first release candidate is a perfect opportunity to give the new version a try. We're looking forward to your feedback and aim for a GA release at the end of May, immediately following Spring Boot 3.3.

Spring Modulith 1.2 RC1发布,包括Spring Boot 3.3 RC1、ArchUnit 1.3和jMolecules 2023.1.3的依赖升级,优化的启动器和参考文档改进。计划在5月底发布GA版本。

相关推荐 去reddit讨论

热榜 Top10

Dify.AI
Dify.AI
LigaAI
LigaAI
观测云
观测云
eolink
eolink

推荐或自荐