use of io.smallrye.common.annotation.Blocking in project quarkus-quickstarts by quarkusio.
the class StarWarsResource method getAllFilmsUsingDynamicClient.
@GET
@Path("/dynamic")
@Produces(MediaType.APPLICATION_JSON)
@Blocking
public List<Film> getAllFilmsUsingDynamicClient() throws Exception {
Document query = document(operation(field("allFilms", field("films", field("title"), field("planetConnection", field("planets", field("name")))))));
Response response = dynamicClient.executeSync(query);
// translate it into an instance of the corresponding model class
return response.getObject(FilmConnection.class, "allFilms").getFilms();
}
use of io.smallrye.common.annotation.Blocking in project AD482-apps by RedHatTraining.
the class NewBankAccountConsumer method processMessage.
// TODO: Create the consumer implementation
@Incoming("new-bank-account-in")
@Blocking
@Transactional
public void processMessage(NewBankAccount message) {
BankAccount entity = BankAccount.findById(message.getId());
if (entity != null) {
entity.profile = message.getBalance() < 100000 ? "regular" : "premium";
LOGGER.info("Updated Bank Account - ID: " + message.getId() + " - Type: " + entity.profile);
} else {
LOGGER.info("Bank Account not found!");
}
}
use of io.smallrye.common.annotation.Blocking in project openk9 by smclab.
the class TenantRegistry method initializeTenantMap.
@Scheduled(every = "30s")
@Blocking
void initializeTenantMap() {
List<Tenant> listTenant = Tenant.<Tenant>list("active = true").await().indefinitely();
Map<String, Tenant> map = new HashMap<>(listTenant.size());
for (Tenant tenant : listTenant) {
map.put(tenant.getVirtualHost(), tenant);
}
_tenantMap.clear();
_tenantMap.putAll(map);
}
Aggregations