Proxy-address-forwarding property from Thorntail to Quarkus - reverse-proxy

in my previous implementation using Thorntail I have used this property to manage the request behind the Proxy (nginx):
thorntail.undertow.servers.default-servers.http-listeners.default.proxy-address-forwarding = true
Which is the right property to use in Quarkus ?
From the documentation I have found out the following one but in my case it doesn't work:
quarkus.http.proxy.proxy-address-forwarding = true
Thanks

I have updated the Quarkus version from 1.7.3-Final to 1.9.2-Final and added these two properties:
quarkus.http.proxy.proxy-address-forwarding = true
quarkus.http.proxy.enable-forwarded-host = true
It works!

Related

Cadence Java client - Worker.Factory cannot be resolved

I am following the samples given in the java client sdk. Specifically
https://github.com/uber/cadence-java-samples/blob/master/src/main/java/com/uber/cadence/samples/hello/HelloWorkerSetup.java
Compiler is not able to resolve
Worker.Factory
I have tried to look in the client SDK code but I cannot seem to get past this error.
Has something changed in how workflows have to be registered?
Thanks
Sanjay
ClientOptions tOptions = ClientOptions.newBuilder().setHost(serverHostName).setPort(serverPort).build() ;
WorkflowServiceTChannel tChannel = new WorkflowServiceTChannel(tOptions);
WorkflowClientOptions clientOptions = WorkflowClientOptions.newBuilder().setDomain(serverDomain).build();
WorkflowClient wfClient = WorkflowClient.newInstance(tChannel,clientOptions);
WorkerFactoryOptions factoryOptions = WorkerFactoryOptions.newBuilder().build();
WorkerFactory factory = WorkerFactory.newInstance(wfClient,factoryOptions);

UWP SyncFusion SfDataGrid Serialization Exception

I'm trying to make use of the SfDataGrid component in my UWP app and have everything working just fine in debug mode. When I switched over to release mode to regression test the app before publishing to the Windows store the app throws an exception during grid serialization.
I have an SfDataGrid defined with 4 text columns, 1 numeric column and 1 template column. The template column just includes a delete button so that the user to can remove the row.
I have a method to return the serialization options as follows:
private SerializationOptions GetGridSerializationOptions()
{
return new SerializationOptions
{
SerializeFiltering = false,
SerializeColumns = true,
SerializeGrouping = true,
SerializeSorting = true,
SerializeTableSummaries = true,
SerializeCaptionSummary = true,
SerializeGroupSummaries = true,
SerializeStackedHeaders = true
};
}
Then I have another method to serialize the grid settings as follows:
private void RetrieveDefaultGridSettings()
{
using (MemoryStream ms = new MemoryStream())
{
gridReport.Serialize(ms, GetGridSerializationOptions());
_defaultGridSettings = Convert.ToBase64String(ms.ToArray());
}
}
I've followed the SyncFusion documentation (https://help.syncfusion.com/uwp/datagrid/serialization-and-deserialization) which describes how to serialize template columns. I have everything working perfectly in debug mode, but when I switch to release mode I get an exception on this line:
gridReport.Serialize(ms, GetGridSerializationOptions());
The exception is:
System.Runtime.Serialization.InvalidDataContractException: 'KnownTypeAttribute attribute on type 'Syncfusion.UI.Xaml.Grid.SerializableGridColumn' specifies a method named 'KnownTypes' to provide known types. Static method 'KnownTypes()' was not found on this type. Ensure that the method exists and is marked as static.'
I've had a look at the SerializableGridColumn class and can see a public static method called KnownTypes so I don't really understand why this exception is happening. I'm even more confused about why it's only happening in release mode.
In attempt to fix the problem I have tried referencing the entire SDK, removing the SDK and referencing the specific assemblies (Syncfusion.SfGrid.UWP, Syncfusion.Data.UWP, Syncfusion.SfInput.UWP, Syncfusion.SfShared.UWP, Syncfusion.SfGridConverter.UWP, Syncfusion.XlsIO.UWP and Syncfusion.Pdf.UWP) but neither yields a different result and the exception still occurs, but only in release mode.
Switching off the setting "Compile with .NET Native tool chain" does resolve the problem, but is not a practical solution as this blocks me from publishing the app to the Windows store.
Thanks very much for any assistance anyone can provide.
After exhausting all possible problems with my own code, I logged with an issue with SyncFusion. They're investigating and will hopefully provide a fix soon.

How to configure a SessionHandler with a SessionContext in Jetty?

jetty-9.4.11.v20180605
I have one project where I'm very happily using Jetty by configuring it programatically (in Kotlin/Java code, not in .xml or .ini files). I'm adding Jetty to an older project and it's working well, except for configuring the SessionHandler. It looks like it never gets the SessionContext 'cause it blows up with a NPE here:
java.lang.NullPointerException
at org.eclipse.jetty.server.session.AbstractSessionDataStore.newSessionData(AbstractSessionDataStore.java:142)
at org.eclipse.jetty.server.session.AbstractSessionCache.newSession(AbstractSessionCache.java:798)
at org.eclipse.jetty.server.session.SessionHandler.newHttpSession(SessionHandler.java:794)
at org.eclipse.jetty.server.Request.getSession(Request.java:1559)
at org.eclipse.jetty.server.Request.getSession(Request.java:1532)
The insufficient config code (in Kotlin) looks like this:
val sessionIdManager = DefaultSessionIdManager(server, SecureRandom())
server.sessionIdManager = sessionIdManager
val sessionHandler = SessionHandler()
sessionHandler.sessionIdManager = sessionIdManager
sessionHandler.sessionCache =
DefaultSessionCacheFactory().getSessionCache(sessionHandler)
val dataStoreFactory = FileSessionDataStoreFactory()
dataStoreFactory.storeDir = File(someDir)
val dataStore = dataStoreFactory.getSessionDataStore(sessionHandler)
sessionHandler.sessionCache.sessionDataStore = dataStore
server.handler = sessionHandler
I think maybe I'm missing a SessionContext in AbstractSessionDataStore which is called from SessionHandler.newHttpSession(), but I don't know how to set that. It looks like SessionContex is associated with SessionHandler by calling sessionHandler.doStart() which is protected in SessionHandler. If this isn't possible, I think I could get by with a WeakHashMap instead of a true Session, but I'm assuming it's better to try to use the existing Session.

How to set Attribute to PDO connection in Codeigniter

How to set attributes (PDO::ATTR_ERRMODE) on the PDO database handle in Codeigniter?
I think a better option is to use a MY_Model (which you then extend and this is available then across the application) and define something like this in the construct:
$this->db->conn_id->setAttribute(PDO::ATTR_ERRMODE,PDO::ERRMODE_EXCEPTION);
Note conn_id allows you to access the main PDO object.
There are two ways:
1. The lazy (hacky) way
Add to the following code into system/core/database/drivers/pdo/pdo_driver.php (in CI 3):
public function db_connect($persistent = FALSE)
{
$this->options[PDO::ATTR_PERSISTENT] = $persistent;
// Added code start
$this->options[PDO::ATTR_ERRMODE] = PDO::ERRMODE_EXCEPTION;
// Added code end
try
{
return new PDO($this->dsn, $this->username, $this->password, $this->options);
...
}
2. The right way
Extend Database Driver and add the same line
Note: If you will set PDO::ERRMODE_EXCEPTION in Codeigniter it will show exception errors even in Production environment.

Check if SERVICE is running VBNET

I want to know if a service is running (VBNET) to return a false or true value
I found other questions with this but the codes didnt work for me..
Thanks you!
Use service controller class to determine whether the service is running or not.
For Each s As ServiceController In ServiceController.GetServices()
If s.ServiceName = "yourservicename" AndAlso s.Status = ServiceControllerStatus.Running Then
Return True
End If
Next
Hope this helps.