Does the usage of Event Grid with Spring require creating a Bean?

Souza Gustavo (BD/XDA3) 0 Pontos de reputação
2025-05-20T19:57:31.3933333+00:00

Under Event Grid Spring docs, it states that as long as the application.yaml file is something like

spring:
  cloud:
    azure:
      eventgrid:
        endpoint: ${AZURE_EVENTGRID_ENDPOINT}
        key: ${AZURE_EVENTGRID_KEY}

and the pom.xml includes

<dependencies>
    // other spring dependencies
	<dependency>
	  <groupId>com.azure.spring</groupId>
	  <artifactId>spring-cloud-azure-starter-eventgrid</artifactId>
	</dependency>
</dependencies>

<dependencyManagement> 
	<dependencies>
		<dependency>
			<groupId>com.azure.spring</groupId>
			<artifactId>spring-cloud-azure-dependencies</artifactId>
			<version>5.22.0</version>
			<type>pom</type>
			<scope>import</scope>
		</dependency>
	</dependencies>
</dependencyManagement>

then injecting EventGridPublisherClient would work.

However, I'm having the following error:

Parameter 0 of constructor in (name of my class) required a bean of type 'com.azure.messaging.eventgrid.EventGridPublisherClient' that could not be found.

Azure
Azure
Uma plataforma de computação em nuvem e uma infraestrutura para criar, implantar e gerenciar aplicativos e serviços por meio de uma rede mundial de datacenters gerenciados pela Microsoft.
121 perguntas
{count} votos

1 resposta

Classificar por: Mais útil
  1. Souza Gustavo (BD/XDA3) 0 Pontos de reputação
    2025-05-23T18:55:56.0966667+00:00

    Hey @Praveen kumar thanks for the answer but, as it works for one type of event and not another, it seems that this is just an ordinary bug. Thank you very much.


Sua resposta

As respostas podem ser marcadas como Respostas Aceitas pelo autor da pergunta, o que ajuda os usuários a saber a resposta que resolveu o problema do autor.