我知道akka-http库在处理请求时编组和解组类类型.但是现在,我需要读取请求的请求参数GET.我尝试了parameter()方法,它返回ParamDefAux类型,但我需要这些值作为字符串类型
我在下面的问题中检查答案.
但不能做我需要的.
请告诉我如何从请求中提取查询参数.或者如何从中提取所需的值ParamDefAux
请求网址
http://host:port/path?key=authType&value=Basic345
Run Code Online (Sandbox Code Playgroud)
获取方法定义
val propName = parameter("key")
val propValue = parameter("value")
complete(persistanceMgr.deleteSetting(propName,propValue))
Run Code Online (Sandbox Code Playgroud)
我的方法声明
def deleteSetting(name:String,value:String): Future[String] = Future{
code...
}
Run Code Online (Sandbox Code Playgroud) 在 redis 中,选择“number”可以访问该索引处的特定数据库。我的 redis 配置设置为 16(为什么?)。我们需要高度扩展我们的应用程序,那么最大限制是多少?
我正在尝试使用 lua 从 nginx 访问 redis 值。当我在命令行上执行 lua 文件时,一切正常,我可以读取值并将值写入 redis。但是当我尝试通过访问写入 access_by_lua 指令的位置来从 nginx 执行相同的文件时,错误日志文件中记录了以下错误
no field package.preload['socket']
no file '/home/sivag/redis/redis-lua/src/socket.lua'
no file 'src/socket.lua'
no file '/home/sivag/lua/socket.lua'
no file '/opt/openresty/lualib/socket.so'
no file './socket.so'
no file '/usr/local/lib/lua/5.1/socket.so'
no file '/opt/openresty/luajit/lib/lua/5.1/socket.so'
no file '/usr/local/lib/lua/5.1/loadall.so'
Run Code Online (Sandbox Code Playgroud)
这是什么原因?我该如何解决这个问题?