spring-boot-admin client custom health-url Invalid - spring-boot-admin

I want to custom client properties, "health-url","management-url","service-url". Here is properties in application.properties.
spring.boot.admin.client.health-url= http://localhost:8080/registry/health
spring.boot.admin.client.management-url= http://localhost:8080/registry
spring.boot.admin.client.service-url= http://localhost:8080/registry
The default properties is
managementUrl=http://localhost:8080,
healthUrl=http://localhost:8080/health,
serviceUrl=http://localhost:8080,
But the properties are ignored.
I find the issue Admin Starter Client ignoring Service,
However the properties is not useful
spring.boot.admin.client.ignoreUnknownFields=true
How can I change the properties?

Related

How to bind different transport configs to datareader in OpenDDS

can different transport(shmem, tcp) bind to different datawriter/datareader in one publisher/subscriber in OpenDDS?
I'm not sure OpenDDS supports this way with RepoInfo Discovery or only in Static Discovery?
I use
`
TheTransportRegistry->bind_config("tcp1", datawriter1);
TheTransportRegistry->bind_config("shmem1", datawriter2);
`
but it seems not work. still use the publisher‘s transport config
Yes, it should be possible, but it needs a bit more setup. After they are created writers and readers (as well as any DDS::Entity) have an enable function that has to be called before they can be used. By default this is called automatically by create_datawriter and create_datareader. This is important because readers and writers can't change their config after they're enabled. You have to disable the autoenable_created_entities property in parent entity's QoS, create the reader or writer, call bin_config, and finally call enable manually. Section 3.2.16 of the OpenDDS Developer's Guide talks a bit about this, but doesn't have an example, so here's snippet that I tested with the error checks and unrelated args omitted:
DDS::PublisherQos pub_qos;
participant->get_default_publisher_qos(pub_qos);
pub_qos.entity_factory.autoenable_created_entities = false;
DDS::Publisher_var publisher =
participant->create_publisher(pub_qos, /*...*/);
DDS::DataWriter_var datawriter1 = publisher->create_datawriter(/*...*/);
TheTransportRegistry->bind_config("tcp1", datawriter1);
datawriter1->enable();
You can also set this QoS on the domain participant or the service participant instead of the publisher or subscriber, but that requires manually enabling all the entities, which includes the publishers, subscribers, and topics, so I'm not sure I recommend that.

How to send and retrieve custom header information for REST WCF Service

I am struggling to set-up infrastructure in my solution to send and retrieve the custom header for REST WCF Service. Basically, we need this to send UserID, password, token value from client to service and if provided values are valid then operation will continue to execute otherwise throw exception.
We already have few classes inherited from interfaces like IDispatchMessageInspector, IClientMessageInspector, IEndPointBehaviour, MessageHeader, etc., This is working fine for WCF with soap request. I tried to use these classes for my new REST WCF Service, but was not working as MessageHeader derived class supports only Soap.
I also tried using WebOperationContext, but no luck :(
Please provide a solution along with sample project to solve this problem.
Thank you so much!
Seems in your case it might be easier to interogate the ASPNET pipeline
if you add the following to your WCF service to allow it to hookup into the ASPNET pipeline
[AspNetCompatibilityRequirements(RequirementsMode =
AspNetCompatibilityRequirementsMode.Allowed)]
Then you can simply now use the HttpContext object and just get the headers as you would from a normal aspnet application, e.g
System.Web.HttpContext.Current.Request.Headers["CustomHeader"]
If you want to add http header in wcf rest service , you should use HttpRequestMessageProperty, it has a Headers property , you could set http Header through its Headers property
using (OperationContextScope scope = new OperationContextScope(client.InnerChannel))
{
HttpRequestMessageProperty property;
// if OutgoingMessageProperties already has HttpRequestMessageProperty, use the existing one , or initialize a new one and
// set OutgoingMessageProperties's HttpRequestMessageProperty.Name key's value to the initialized HttpRequestMessageProperty so that the HttpRequestMessageProperty will work
if (OperationContext.Current.OutgoingMessageProperties.ContainsKey(HttpRequestMessageProperty.Name)){
property = OperationContext.Current.OutgoingMessageProperties[HttpRequestMessageProperty.Name] as HttpRequestMessageProperty;
}
else
{
property = new HttpRequestMessageProperty();
OperationContext.Current.OutgoingMessageProperties[HttpRequestMessageProperty.Name] = property;
}
// add headers to HttpRequestMessageProperty, it will become the http header of the reuqest
property.Headers.Add(System.Net.HttpRequestHeader.Authorization, "myAuthorization");
string re = client.HelloWorld();
}
About getting the Header , just use WebOperationContext.Current.Headers.
WebOperationContext.Current.IncomingRequest.Headers["MyCustomHttpHeader"]
Please refer to http://kenneththorman.blogspot.com/2011/02/wcf-rest-client-using-custom-http.html

AEM resource resolver failing

I am working on the AEM resource resolver and I currently have the following configuration on the Adobe Sling Resource Resolver Factory.
/content/mywebsite/>/
I have this a tag being generated from a component that looks something like:
<a data-desktop='/content/mywebsite/desktop.html'
data-android-href='/content/mywebsite/android.html'
data-ios-href='/content/mywebsite/mywebsite/ios.html'
href='/content/mywebsite/normal.html'>Click here</a>
This should have ideally been resolved to something likeL
<a data-desktop='/desktop.html'
data-adroid-href='/android.html'
data-ios-href='ios.html'
href='/normal.html'>Click here</a>
The irony is the last href in the above a tag is also not resolved by the resource resolver and I'm still getting the unresolved URL on dispatcher.
All the other resource resolver for a tags with just <a href='/content/mywebsite/something.html></a>' gets resolved. I don't understand why the resource resolver does not pick up the one with multiple data elements.
Are you sure it depends on the number of attributes? It looks like your configuration only affects resource resolution and not the outgoing mapping. The rule will be applied for incoming requests so when the user hits your AEM instance with /something.html, the Resource Resolver will look for the resource at /content/mywebsite.something, as well as other paths mapped to the root (if any) but as far as I understand, it will not affect the way AEM renders links to that content.
Try changing your rule so that it uses a two way mapping: /content/mywebsite/:/
To quote the description of the URL Mappings field in the Apache Sling Resource Resolver Factory configuration in the OSGi console:
List of mappings to apply to paths. Incoming mappings are applied to request paths to map to resource paths, outgoing mappings are applied to map resource paths to paths used on subsequent requests. Form is <internalPathPrefix><op><externalPathPrefix> where <op> is ">" for incoming mappings, "<" for outgoing mappings and ":" for mappings applied in both directions. Mappings are applied in configuration order by comparing and replacing URL prefixes. Note: The use of "-" as the <op> value indicating a mapping in both directions is deprecated. (resource.resolver.mapping)
You can easily test the configurations you setin the Apache Sling Resource Resolver Factory using the Configuration Test field on the Resource Resolver page in the OSGi console. You'll find it at http://<host>:<port>/system/console/jcrresolver
Use the Resolve and Map buttons to se.e how the path is transformed both ways.
Also, if you're getting inconsistent behaviour between components, check if they both map the URLs using resourceResolver#map if not covered by the Externalizer already.

How custom parse typesafe configuration?

I want to pass seed node to akka application. For now I have to set java options like that:
-Dakka.cluster.seed-nodes.0="akka.tcp://systemName#127.0.0.1:2551"
-Dakka.cluster.seed-nodes.1="akka.tcp://systemName#127.0.0.2:2551"
Is there a wat to use IP address shortcut like that:
-Dakka.cluster.seed-nodes.0="127.0.0.1:2551"
-Dakka.cluster.seed-nodes.1="127.0.0.2:2551"
Can add for example a custom parse for this property passed from commandline?

Alternate way of configuring data sources in quartz scheduler properties file

We are configuring the Quartz Scheduler data sources as specified in the documentation that is by providing all the details without encrypting the data base details. By this the data base details are exposed to the other users and any one who have access to the file system can easily get hands on.
So are there any other ways to provide the data sources details using API or provide the database details by encrypting and providing the details as part of quartz.properties file
On class "StdSchedulerFactory" you can call the method "initialize(Properties props)" to set needed propertries by API. Then you don't need a property-file. (See: StdSchedulerFactory API)
Example:
public Scheduler createSchedulerWithProperties(Properties props)
throws SchedulerException {
StdSchedulerFactory factory = new StdSchedulerFactory(props);
return factory.getScheduler();
}
But then you have to set all properties of SchedulerFactory. Also the properties, that have a default value with default constructor. (Search for 'quartz.properties' inside of 'quartz-2.2.X.jar' to get default property values of quartz.)