OCI object storage api fehler behoben
This commit is contained in:
@@ -9,7 +9,10 @@
|
||||
"Bash(sed -n '582,600p' \"C:\\\\src\\\\Galabau\\\\glb-spielwiese\\\\database\\\\packages\\\\pck_net_storage.pkb\")",
|
||||
"WebFetch(domain:docs.public.oneportal.content.oci.oraclecloud.com)",
|
||||
"Bash(./mvnw compile *)",
|
||||
"WebFetch(domain:medium.com)"
|
||||
"WebFetch(domain:medium.com)",
|
||||
"WebFetch(domain:quarkus.io)",
|
||||
"WebFetch(domain:github.com)",
|
||||
"WebFetch(domain:walidhajeri.hashnode.dev)"
|
||||
]
|
||||
}
|
||||
}
|
||||
|
||||
2
quarkus-automaton/.vscode/settings.json
vendored
2
quarkus-automaton/.vscode/settings.json
vendored
@@ -1,3 +1,3 @@
|
||||
{
|
||||
"java.configuration.updateBuildConfiguration": "interactive"
|
||||
"java.configuration.updateBuildConfiguration": "disabled"
|
||||
}
|
||||
@@ -75,17 +75,11 @@
|
||||
<version>0.38.0</version>
|
||||
</dependency>
|
||||
|
||||
<!-- OCI Object Storage SDK -->
|
||||
<!-- Aktuelle Version: https://mvnrepository.com/artifact/com.oracle.oci.sdk/oci-java-sdk-objectstorage -->
|
||||
<!-- OCI Object Storage SDK — Shaded Full JAR: Jersey und alle internen Abhängigkeiten sind unter
|
||||
shaded.com.oracle.oci.javasdk.* relokiert, sodass Quarkus RESTEasy die OCI-Provider nicht scannt -->
|
||||
<dependency>
|
||||
<groupId>com.oracle.oci.sdk</groupId>
|
||||
<artifactId>oci-java-sdk-objectstorage</artifactId>
|
||||
<version>3.44.0</version>
|
||||
</dependency>
|
||||
<!-- HTTP-Provider für OCI SDK (jersey3 = Jakarta EE 9+, kompatibel mit Quarkus) -->
|
||||
<dependency>
|
||||
<groupId>com.oracle.oci.sdk</groupId>
|
||||
<artifactId>oci-java-sdk-common-httpclient-jersey3</artifactId>
|
||||
<artifactId>oci-java-sdk-shaded-full</artifactId>
|
||||
<version>3.44.0</version>
|
||||
</dependency>
|
||||
|
||||
|
||||
@@ -1,5 +1,6 @@
|
||||
package de.galabau.dateieingang.oci;
|
||||
|
||||
import com.oracle.bmc.Region;
|
||||
import com.oracle.bmc.auth.SimpleAuthenticationDetailsProvider;
|
||||
import com.oracle.bmc.objectstorage.ObjectStorage;
|
||||
import com.oracle.bmc.objectstorage.ObjectStorageClient;
|
||||
@@ -9,6 +10,7 @@ import de.galabau.dateieingang.exception.OciException;
|
||||
import de.galabau.dateieingang.model.FileEntry;
|
||||
import de.galabau.dateieingang.model.ProcessingContext;
|
||||
import io.quarkus.logging.Log;
|
||||
import io.quarkus.runtime.Startup;
|
||||
import jakarta.annotation.PostConstruct;
|
||||
import jakarta.enterprise.context.ApplicationScoped;
|
||||
import jakarta.inject.Inject;
|
||||
@@ -23,6 +25,7 @@ import java.util.List;
|
||||
* Lädt die entpackten Dateien und den Marker in OCI Object Storage hoch.
|
||||
* Authentifizierung via OCI HTTP Signature V1 (entspricht APEX Web Credential vom Typ OCI).
|
||||
*/
|
||||
//@Startup
|
||||
@ApplicationScoped
|
||||
public class OciUploadService {
|
||||
|
||||
@@ -34,10 +37,12 @@ public class OciUploadService {
|
||||
@PostConstruct
|
||||
void init() {
|
||||
Log.info("Initialisiere OCI ObjectStorage-Client...");
|
||||
try {
|
||||
SimpleAuthenticationDetailsProvider auth = SimpleAuthenticationDetailsProvider.builder()
|
||||
.tenantId(config.tenancyId())
|
||||
.userId(config.userId())
|
||||
.fingerprint(config.fingerprint())
|
||||
.region(Region.fromRegionId(config.region()))
|
||||
.privateKeySupplier(() -> {
|
||||
try {
|
||||
return Files.newInputStream(Path.of(config.privateKeyPath()));
|
||||
@@ -47,11 +52,14 @@ public class OciUploadService {
|
||||
}
|
||||
})
|
||||
.build();
|
||||
Log.info("Auhtentifizierung...");
|
||||
Log.info("Authentifizierung...");
|
||||
client = ObjectStorageClient.builder()
|
||||
.endpoint("https://objectstorage." + config.region() + ".oraclecloud.com")
|
||||
.build(auth);
|
||||
Log.infof("OCI ObjectStorage-Client initialisiert (Region: %s, Bucket: %s)", config.region(), config.bucket());
|
||||
} catch (Throwable e) {
|
||||
Log.errorf(e, "OCI ObjectStorage-Client Initialisierung fehlgeschlagen");
|
||||
throw new RuntimeException("OCI-Client konnte nicht initialisiert werden", e);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
@@ -69,7 +69,7 @@ public class FileProcessingPipeline {
|
||||
executor.submit(() -> {
|
||||
try {
|
||||
processAll();
|
||||
} catch (Exception e) {
|
||||
} catch (Throwable e) { // nicht exception catchen, weil Error in OCI SDK auftreten können, die Throwable aber nicht Excption sind. Die würden sonst nicht geloggt
|
||||
Log.errorf(e, "Unerwarteter Fehler im Pipeline-Lauf");
|
||||
} finally {
|
||||
isRunning.set(false);
|
||||
|
||||
@@ -39,7 +39,7 @@ galabau.oci.fingerprint=${OCI_FINGERPRINT}
|
||||
# Base-URL bis einschließlich Modul-Pfad, z.B. https://apex.example.com/ords/myschema/auto_import
|
||||
galabau.ords.base-url=${GALABAU_ORDS_BASE_URL}
|
||||
galabau.ords.api-key=${GALABAU_ORDS_API_KEY}
|
||||
# MicroProfile REST Client liest die URL aus dieser Property:
|
||||
# MicroProfile REST Client liest die URL aus dieser Property. Das hier ist eine einfache weiterleitung auf die env variable GALABAU_ORDS_BASE_URL (s.o.)
|
||||
quarkus.rest-client.ords-client.url=${galabau.ords.base-url}
|
||||
|
||||
# ===== Observability =====
|
||||
|
||||
Reference in New Issue
Block a user